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-

Bug is probably present in _create_carefully() function in mailbox.py.
os.open() takes mode argument (which defaults to 0777) but it's not
supplied there.

#v+
$ grep -A2 'def _create_carefully' /usr/lib/python2.5/mailbox.py
def _create_carefully(path):
    """Create a file if it doesn't exist and open for reading and
writing."""
    fd = os.open(path, os.O_CREAT | os.O_EXCL | os.O_RDWR)
#v-

----------
components: Library (Lib)
messages: 68896
nosy: pl
severity: normal
status: open
title: mailbox.mbox creates files with execute bit set
type: behavior
versions: Python 2.5

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3228>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to