Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4272d6a

Browse files
committed
Fix some mentions of IOError
1 parent a787b65 commit 4272d6a

4 files changed

Lines changed: 14 additions & 6 deletions

File tree

Doc/library/chunk.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ instance will fail with a :exc:`EOFError` exception.
8484
Close and skip to the end of the chunk. This does not close the
8585
underlying file.
8686

87-
The remaining methods will raise :exc:`IOError` if called after the
88-
:meth:`close` method has been called.
87+
The remaining methods will raise :exc:`OSError` if called after the
88+
:meth:`close` method has been called. Before Python 3.3, they used to
89+
raise :exc:`IOError`, now an alias of :exc:`OSError`.
8990

9091

9192
.. method:: isatty()

Doc/library/fileinput.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ as the first argument to :func:`.input`. A single file name is also allowed.
2828
All files are opened in text mode by default, but you can override this by
2929
specifying the *mode* parameter in the call to :func:`.input` or
3030
:class:`FileInput`. If an I/O error occurs during opening or reading a file,
31-
:exc:`IOError` is raised.
31+
:exc:`OSError` is raised.
32+
33+
.. versionchanged:: 3.3
34+
:exc:`IOError` used to be raised; it is now an alias of :exc:`OSError`.
3235

3336
If ``sys.stdin`` is used more than once, the second and further use will return
3437
no lines, except perhaps for interactive use, or if it has been explicitly reset

Doc/library/signal.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,11 @@ The :mod:`signal` module defines one exception:
145145
Raised to signal an error from the underlying :func:`setitimer` or
146146
:func:`getitimer` implementation. Expect this error if an invalid
147147
interval timer or a negative time is passed to :func:`setitimer`.
148-
This error is a subtype of :exc:`IOError`.
148+
This error is a subtype of :exc:`OSError`.
149+
150+
.. versionadded:: 3.3
151+
This error used to be a subtype of :exc:`IOError`, which is now an
152+
alias of :exc:`OSError`.
149153

150154

151155
The :mod:`signal` module defines the following functions:
@@ -396,7 +400,7 @@ be sent, and the handler raises an exception. ::
396400

397401
def handler(signum, frame):
398402
print('Signal handler called with signal', signum)
399-
raise IOError("Couldn't open device!")
403+
raise OSError("Couldn't open device!")
400404

401405
# Set the signal handler and a 5-second alarm
402406
signal.signal(signal.SIGALRM, handler)

Doc/library/urllib.request.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ some point in the future.
11721172
*key_file* and *cert_file* are supported to provide an SSL key and certificate;
11731173
both are needed to support client authentication.
11741174

1175-
:class:`URLopener` objects will raise an :exc:`IOError` exception if the server
1175+
:class:`URLopener` objects will raise an :exc:`OSError` exception if the server
11761176
returns an error code.
11771177

11781178
.. method:: open(fullurl, data=None)

0 commit comments

Comments
 (0)