[Python-checkins] cpython (3.2): #11306: Treat EROFS like EACCES when making a 'file is read-only' decision
r.david.murray
python-checkins at python.org
Wed Mar 2 16:20:51 CET 2011
http://hg.python.org/cpython/rev/75541fc89b11
changeset: 68073:75541fc89b11
branch: 3.2
parent: 68064:d6404ebb622d
user: R David Murray <rdmurray at bitdance.com>
date: Tue Mar 01 22:26:14 2011 -0500
summary:
#11306: Treat EROFS like EACCES when making a 'file is read-only' decision
files:
Lib/mailbox.py
diff --git a/Lib/mailbox.py b/Lib/mailbox.py
--- a/Lib/mailbox.py
+++ b/Lib/mailbox.py
@@ -578,7 +578,7 @@
f = open(self._path, 'wb+')
else:
raise NoSuchMailboxError(self._path)
- elif e.errno == errno.EACCES:
+ elif e.errno in (errno.EACCES, errno.EROFS):
f = open(self._path, 'rb')
else:
raise
@@ -2012,7 +2012,7 @@
pre_lock = _create_temporary(f.name + '.lock')
pre_lock.close()
except IOError as e:
- if e.errno == errno.EACCES:
+ if e.errno in (errno.EACCES, errno.EROFS):
return # Without write access, just skip dotlocking.
else:
raise
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list