[Python-checkins] r88731 - in python/branches/release32-maint: Lib/mailbox.py Misc/NEWS

r.david.murray python-checkins at python.org
Thu Mar 3 19:12:34 CET 2011


Author: r.david.murray
Date: Thu Mar 3 19:12:34 2011
New Revision: 88731
Log:
Merged revisions 88730 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
 r88730 | r.david.murray | 2011年03月03日 13:03:36 -0500 (2011年3月03日) | 2 lines
 
 #11306: Treat EROFS like EACCES when making a 'file is read-only' decision
........
Modified:
 python/branches/release32-maint/ (props changed)
 python/branches/release32-maint/Lib/mailbox.py
 python/branches/release32-maint/Misc/NEWS
Modified: python/branches/release32-maint/Lib/mailbox.py
==============================================================================
--- python/branches/release32-maint/Lib/mailbox.py	(original)
+++ python/branches/release32-maint/Lib/mailbox.py	Thu Mar 3 19:12:34 2011
@@ -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
@@ -2002,7 +2002,7 @@
 try:
 fcntl.lockf(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
 except IOError as e:
- if e.errno in (errno.EAGAIN, errno.EACCES):
+ if e.errno in (errno.EAGAIN, errno.EACCES, errno.EROFS):
 raise ExternalClashError('lockf: lock unavailable: %s' %
 f.name)
 else:
@@ -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
Modified: python/branches/release32-maint/Misc/NEWS
==============================================================================
--- python/branches/release32-maint/Misc/NEWS	(original)
+++ python/branches/release32-maint/Misc/NEWS	Thu Mar 3 19:12:34 2011
@@ -28,6 +28,10 @@
 Library
 -------
 
+- Issue #11306: mailbox in certain cases adapts to an inability to open
+ certain files in read-write mode. Previously it detected this by
+ checking for EACCES, now it also checks for EROFS.
+
 - Issue #11265: asyncore now correctly handles EPIPE, EBADF and EAGAIN errors
 on accept(), send() and recv().
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /