This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author smyrman
Recipients jab, loewis, r.david.murray, smyrman
Date 2010-06-14.23:13:23
SpamBayes Score 0.0019446118
Marked as misclassified No
Message-id <1276557206.37.0.557040933884.issue5220@psf.upfronthosting.co.za>
In-reply-to
Content
>I don't understand what you mean when you say "how umask works in 
>relation to Python".  How it works in relation to Python isn't different 
>from how it works for any other Unix program.  Consider, for example, 
>the unix man page for 'open'.

This is what I mean.
The following gnu commands give (on Archlinux):
$ umask
0022
$ mkdir test1
$ mkdir test2 --mode 0777
$ ls -l
drwxr-xr-x 2 sindrero users 4096 Jun 15 00:59 test
drwxrwxrwx 2 sindrero users 4096 Jun 15 00:59 test2

So we see that new folder created with the --mode parameter to gnu's mkdir does not get the umask masked out.

The following code in python gives:
>> import os
>> os.mkdir('test3')
>> os.mkdir('test4')
>> exit()
$ ls -l
drwxr-xr-x 2 sindrero users 4096 Jun 15 01:01 test3
drwxr-xr-x 2 sindrero users 4096 Jun 15 01:01 test4

I (as a programmer) have never seen the specific code for python's mkdir function, And I have no way to know whether I should presume that mkdir in python works the same way as the gnu command or not. Unless it is documented that is.

Cheers :)
History
Date User Action Args
2010-06-14 23:13:26smyrmansetrecipients: + smyrman, loewis, r.david.murray, jab
2010-06-14 23:13:26smyrmansetmessageid: <1276557206.37.0.557040933884.issue5220@psf.upfronthosting.co.za>
2010-06-14 23:13:24smyrmanlinkissue5220 messages
2010-06-14 23:13:24smyrmancreate