[ python-Bugs-1106572 ] os.makedirs() ignores mode parameter

SourceForge.net noreply at sourceforge.net
Mon Jan 24 13:48:05 CET 2005


Bugs item #1106572, was opened at 2005-01-21 10:42
Message generated for change (Comment added) made by calvin
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1106572&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Andreas Jung (ajung)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.makedirs() ignores mode parameter

Initial Comment:
os.makedirs('foo/x', 0777) does not create the directories
with permissions g+rwx,u+rwx,o+rwx but instead:

>>> import os
>>> os.makedirs('foo/xx', 0777)
>>>
[2]+  Stopped                 python2.3
ajung at hrs2dev2:~/sandboxes/haufecms/instance/Products/HaufeCMS:
ls -la foo
insgesamt 12
drwxr-xr-x   3 ajung ajung 4096 2005-01-21 10:39 .
drwxr-xr-x  19 ajung ajung 4096 2005-01-21 10:39 ..
drwxr-xr-x   2 ajung ajung 4096 2005-01-21 10:39 xx


This happens with Python 2.3.4 on Linux


----------------------------------------------------------------------

Comment By: Wummel (calvin)
Date: 2005-01-24 13:48

Message:
Logged In: YES 
user_id=9205

What is the current process umask? The resulting directory
mode will always be (mode &  ~umask  &  0777).
To be sure that os.makedirs() will use the given mode
without modification, you have to execute os.umask(0)
beforehand.

So this bug is probably invalid if you forgot to set your
umask accordingly.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1106572&group_id=5470


More information about the Python-bugs-list mailing list