New submission from Serhiy Storchaka: os.makedirs() can't create a directory with cleared write or list permission bits for owner when parent directories aren't created. This is because for parent directories same mode is used as for final directory.
Note that the mkdir utility creates parent directories with default mode (0o777 & ~umask). $ mkdir -p -m 0 t1/t2/t3 $ ls -l -d t1 t1/t2 t1/t2/t3 drwxrwxr-x 3 serhiy serhiy 4096 Dec 7 22:30 t1/ drwxrwxr-x 3 serhiy serhiy 4096 Dec 7 22:30 t1/t2/ d--------- 2 serhiy serhiy 4096 Dec 7 22:30 t1/t2/t3/ The proposed patch emulates the mkdir utility. See also issue19921. ---------- components: Library (Lib) messages: 205543 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: os.makedirs('dir1/dir2', 0) always fails type: behavior versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19930> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com