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 doko
Recipients doko
Date 2009-11-19.16:15:23
SpamBayes Score 2.220446e-16
Marked as misclassified No
Message-id <1258647326.68.0.261951425057.issue7359@psf.upfronthosting.co.za>
In-reply-to
Content
no change in behaviour in 2.6

the mailbox module in python 2.5 cannot modify mboxes in read-only
directories, e.g. the system mail spool.  This is because
mailbox._singlefileMailbox.flush() tries to write the modified mailbox
to a temporary file and then rename it.  See: 

penelope[tmp]$ python2.5
Python 2.5 (release25-maint, Dec  9 2006, 14:35:53) 
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-20)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mailbox
>>> mbox = mailbox.mbox("/var/mail/nikolaus")
>>> mbox.clear()
>>> mbox.close()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/mailbox.py", line 623, in close
    self.flush()
  File "/usr/lib/python2.5/mailbox.py", line 570, in flush
    new_file = _create_temporary(self._path)
  File "/usr/lib/python2.5/mailbox.py", line 1885, in _create_temporary
    os.getpid()))
  File "/usr/lib/python2.5/mailbox.py", line 1875, in _create_carefully
    fd = os.open(path, os.O_CREAT | os.O_EXCL | os.O_RDWR)
OSError: [Errno 13] Permission denied:
'/tmp/mail/nikolaus.1195061622.penelope.4241'
>>>
History
Date User Action Args
2009-11-19 16:15:26dokosetrecipients: + doko
2009-11-19 16:15:26dokosetmessageid: <1258647326.68.0.261951425057.issue7359@psf.upfronthosting.co.za>
2009-11-19 16:15:24dokolinkissue7359 messages
2009-11-19 16:15:23dokocreate