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
51ae77c5
Commit
51ae77c5
authored
Apr 01, 2014
by
Andrew Svetlov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of deprecated IOError in the doc
parent
c8d2ca0a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
Doc/c-api/exceptions.rst
Doc/c-api/exceptions.rst
+2
-2
Doc/howto/unicode.rst
Doc/howto/unicode.rst
+1
-1
Doc/library/importlib.rst
Doc/library/importlib.rst
+6
-6
Doc/tutorial/controlflow.rst
Doc/tutorial/controlflow.rst
+1
-1
Doc/tutorial/errors.rst
Doc/tutorial/errors.rst
+2
-2
No files found.
Doc/c-api/exceptions.rst
View file @
51ae77c5
...
...
@@ -236,8 +236,8 @@ in various ways. There is a separate error indicator for each thread.
Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that if
*filenameObject* is not *NULL*, it is passed to the constructor of *type* as
a third parameter. In the case of
exceptions such as :exc:`IOError` and
:exc:`OSError`,
this is used to define the :attr:`filename` attribute of the
a third parameter. In the case of
:exc:`OSError` exception,
this is used to define the :attr:`filename` attribute of the
exception instance.
...
...
Doc/howto/unicode.rst
View file @
51ae77c5
...
...
@@ -246,7 +246,7 @@ include a Unicode character in a string literal::
try:
with open('/tmp/input.txt', 'r') as f:
...
except
IO
Error:
except
OS
Error:
# 'File not found' error message.
print("Fichier non trouvé")
...
...
Doc/library/importlib.rst
View file @
51ae77c5
...
...
@@ -449,12 +449,12 @@ ABC hierarchy::
Loaders that have a file-like storage back-end
that allows storing arbitrary data
can implement this abstract method to give direct access
to the data stored. :exc:`
IO
Error` is to be raised if the *path* cannot
to the data stored. :exc:`
OS
Error` is to be raised if the *path* cannot
be found. The *path* is expected to be constructed using a module'
s
:
attr
:`
__file__
`
attribute
or
an
item
from
a
package
's :attr:`__path__`.
.. versionchanged:: 3.4
Raises :exc:`
IO
Error` instead of :exc:`NotImplementedError`.
Raises :exc:`
OS
Error` instead of :exc:`NotImplementedError`.
.. class:: InspectLoader
...
...
@@ -609,12 +609,12 @@ ABC hierarchy::
- ``'
size
'`` (optional): the size in bytes of the source code.
Any other keys in the dictionary are ignored, to allow for future
extensions. If the path cannot be handled, :exc:`
IO
Error` is raised.
extensions. If the path cannot be handled, :exc:`
OS
Error` is raised.
.. versionadded:: 3.3
.. versionchanged:: 3.4
Raise :exc:`
IO
Error` instead of :exc:`NotImplementedError`.
Raise :exc:`
OS
Error` instead of :exc:`NotImplementedError`.
.. method:: path_mtime(path)
...
...
@@ -624,10 +624,10 @@ ABC hierarchy::
.. deprecated:: 3.3
This method is deprecated in favour of :meth:`path_stats`. You don'
t
have
to
implement
it
,
but
it
is
still
available
for
compatibility
purposes
.
Raise
:
exc
:`
IO
Error
`
if
the
path
cannot
be
handled
.
purposes
.
Raise
:
exc
:`
OS
Error
`
if
the
path
cannot
be
handled
.
..
versionchanged
::
3.4
Raise
:
exc
:`
IO
Error
`
instead
of
:
exc
:`
NotImplementedError
`.
Raise
:
exc
:`
OS
Error
`
instead
of
:
exc
:`
NotImplementedError
`.
..
method
::
set_data
(
path
,
data
)
...
...
Doc/tutorial/controlflow.rst
View file @
51ae77c5
...
...
@@ -370,7 +370,7 @@ defined to allow. For example::
return False
retries = retries - 1
if retries < 0:
raise
IO
Error('uncooperative user')
raise
OS
Error('uncooperative user')
print(complaint)
This function can be called in several ways:
...
...
Doc/tutorial/errors.rst
View file @
51ae77c5
...
...
@@ -131,8 +131,8 @@ the exception (allowing a caller to handle the exception as well)::
f = open('myfile.txt')
s = f.readline()
i = int(s.strip())
except
IO
Error as err:
print("
I/O
error: {0}".format(err))
except
OS
Error as err:
print("
OS
error: {0}".format(err))
except ValueError:
print("Could not convert data to an integer.")
except:
...
...
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