[issue3228] mailbox.mbox creates files with execute bit set

2008-08-04 Thread A.M. Kuchling
A.M. Kuchling <[EMAIL PROTECTED]> added the comment: I took one test and an idea from Niels' patch -- checking for the existence of os.stat as well as os.umask -- and applied it as rev. 65536. Closing this issue now. Thanks, everyone! -- assignee: -> akuchling resolution: -> fixed

[issue3228] mailbox.mbox creates files with execute bit set

2008-08-04 Thread Niels Gustäbel
Niels Gustäbel <[EMAIL PROTECTED]> added the comment: I agree regarding the os.open call in MH.__setitem__. It does not include the O_CREAT flag, so the mode would never be used. ___ Python tracker <[EMAIL PROTECTED]> ___

[issue3228] mailbox.mbox creates files with execute bit set

2008-08-03 Thread A.M. Kuchling
A.M. Kuchling <[EMAIL PROTECTED]> added the comment: There's another use of os.open in the module in the MH class's __setitem__ that doesn't provide a mode, but I think this occurrence is harmless; it's truncating a file that always exists, so the existing mode is preserved. Here's the little te

[issue3228] mailbox.mbox creates files with execute bit set

2008-08-03 Thread A.M. Kuchling
A.M. Kuchling <[EMAIL PROTECTED]> added the comment: Committed to trunk in rev. 65472, along with two corresponding tests. -- nosy: +akuchling ___ Python tracker <[EMAIL PROTECTED]> __

[issue3228] mailbox.mbox creates files with execute bit set

2008-08-03 Thread Niels Gustäbel
Niels Gustäbel <[EMAIL PROTECTED]> added the comment: Of course you are right... Added file: http://bugs.python.org/file11042/mailbox-fix-w-tests-v2.diff ___ Python tracker <[EMAIL PROTECTED]> ___

[issue3228] mailbox.mbox creates files with execute bit set

2008-08-03 Thread Jakub Wilk
Jakub Wilk <[EMAIL PROTECTED]> added the comment: For consistency with other methods, test_folder_file_permissions() should set umask to 0. ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue3228] mailbox.mbox creates files with execute bit set

2008-08-03 Thread Niels Gustäbel
Niels Gustäbel <[EMAIL PROTECTED]> added the comment: I've added tests for all mailbox formats and the maildirfolder marker, so I think all aspects of the fix are covered. The permissions of temporary files and lock files are not checked, but they are basically all using the _create_carefully() f

[issue3228] mailbox.mbox creates files with execute bit set

2008-08-02 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: It would be nice if the patch came with a test. -- nosy: +pitrou ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue3228] mailbox.mbox creates files with execute bit set

2008-08-02 Thread Niels Gustäbel
Niels Gustäbel <[EMAIL PROTECTED]> added the comment: The problem is not limited to mboxes but also applies to maildirs. Any message file created inside a maildir has execute permissions set as well because the same function _create_carefully() is used. Changing the umask is not an option becaus

[issue3228] mailbox.mbox creates files with execute bit set

2008-08-01 Thread Jack Diederich
Jack Diederich <[EMAIL PROTECTED]> added the comment: mailbox.py uses os.open instead of the builtin open() because it wants to pass the exclusive flag (O_EXCL). As a result your 0077 umask gets combined with the default of 0777 like this: 0777 & ~0077 == 0700 == '-rwx--' So you probably w

[issue3228] mailbox.mbox creates files with execute bit set

2008-06-28 Thread Jakub Wilk
Changes by Jakub Wilk <[EMAIL PROTECTED]>: -- nosy: +jwilk ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailing list

[issue3228] mailbox.mbox creates files with execute bit set

2008-06-28 Thread Piotr Lewandowski
New submission from Piotr Lewandowski <[EMAIL PROTECTED]>: #v+ $ umask 0077 $ stat /tmp/foobar stat: cannot stat `/tmp/foobar': No such file or directory $ python -c "from mailbox import mbox; m=mbox('/tmp/foobar', create=True); m.add(''); m.close()" $ stat -c '%A' /tmp/foobar -rwx-- #v-