New submission from John Jones: os.makedirs() gives the optional variable mode to set the permissions on the directories it creates.
While it seems to work for all triplet octal values (777,755,etc) it doesn't seem to work on values with the sticky bit (1777,1755,etc) I know that to set the value as octal, you need, for some reason, to prepend a '0' to the number, such that the final value is '01755' - but even if you do int('1755',8) the error is there. Below I make a directory and then chmod it to the right value: os.makedirs('/Users/Carolin/Desktop/demo',01703) drwx-----x 2 Carolin staff 68 12 Jul 18:53 demo os.chmod('/Users/Carolin/Desktop/demo',01703) drwx----wt 2 Carolin staff 68 12 Jul 18:53 demo ---------- messages: 246655 nosy: John Jones priority: normal severity: normal status: open title: os.makedirs()'s [mode] not correct type: behavior versions: Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24617> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com