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
9e6649f8
Commit
9e6649f8
authored
May 03, 2008
by
Gregory P. Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport r61468 from trunk: Improves the text of the IOError raised
when open() returns EINVAL. See issue2158.
parent
fb30cdbf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
Objects/fileobject.c
Objects/fileobject.c
+5
-2
No files found.
Objects/fileobject.c
View file @
9e6649f8
...
@@ -256,9 +256,12 @@ open_the_file(PyFileObject *f, char *name, char *mode)
...
@@ -256,9 +256,12 @@ open_the_file(PyFileObject *f, char *name, char *mode)
else
if
(
errno
==
EINVAL
)
/* unknown, but not a mode string */
else
if
(
errno
==
EINVAL
)
/* unknown, but not a mode string */
errno
=
ENOENT
;
errno
=
ENOENT
;
#endif
#endif
/* EINVAL is returned when an invalid filename or
* an invalid mode is supplied. */
if
(
errno
==
EINVAL
)
if
(
errno
==
EINVAL
)
PyErr_Format
(
PyExc_IOError
,
"invalid mode: %s"
,
PyErr_Format
(
PyExc_IOError
,
mode
);
"invalid filename: %s or mode: %s"
,
name
,
mode
);
else
else
PyErr_SetFromErrnoWithFilenameObject
(
PyExc_IOError
,
f
->
f_name
);
PyErr_SetFromErrnoWithFilenameObject
(
PyExc_IOError
,
f
->
f_name
);
f
=
NULL
;
f
=
NULL
;
...
...
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