Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
91221f28
Commit
91221f28
authored
Mar 03, 2011
by
R. David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#11306: Treat EROFS like EACCES when making a 'file is read-only' decision
parent
acdad9a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
Lib/mailbox.py
Lib/mailbox.py
+3
-3
Misc/NEWS
Misc/NEWS
+4
-0
No files found.
Lib/mailbox.py
View file @
91221f28
...
...
@@ -578,7 +578,7 @@ class _singlefileMailbox(Mailbox):
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 @@ def _lock_file(f, dotlock=True):
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 @@ def _lock_file(f, dotlock=True):
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
...
...
Misc/NEWS
View file @
91221f28
...
...
@@ -52,6 +52,10 @@ Core and Builtins
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().
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment