Message129252
When opening mailboxes the module checks for errno.EACCES. This doesn't help if the location is mounted read-only. Something like the following (against Python 2.6) would fix it, there are a few other checks in mailbox.py for EACCES too.
--- mailbox.py.orig 2011-02-24 15:02:22.000000000 +0800
+++ mailbox.py 2011-02-24 15:02:05.000000000 +0800
@@ -512,7 +512,7 @@ class _singlefileMailbox(Mailbox):
f = open(self._path, 'wb+')
else:
raise NoSuchMailboxError(self._path)
- elif e.errno == errno.EACCES:
+ elif e.errno == errno.EACCES or e.errno == errno.EROFS:
f = open(self._path, 'rb')
else:
raise |
|
Date |
User |
Action |
Args |
2011-02-24 07:03:33 | matt | set | recipients:
+ matt |
2011-02-24 07:03:32 | matt | set | messageid: <1298531012.94.0.719284706533.issue11306@psf.upfronthosting.co.za> |
2011-02-24 07:03:32 | matt | link | issue11306 messages |
2011-02-24 07:03:32 | matt | create | |
|