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 matt
Recipients matt
Date 2011-02-24.07:03:32
SpamBayes Score 0.012505163
Marked as misclassified No
Message-id <1298531012.94.0.719284706533.issue11306@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2011-02-24 07:03:33mattsetrecipients: + matt
2011-02-24 07:03:32mattsetmessageid: <1298531012.94.0.719284706533.issue11306@psf.upfronthosting.co.za>
2011-02-24 07:03:32mattlinkissue11306 messages
2011-02-24 07:03:32mattcreate