[Python-checkins] cpython: Fix some mentions of IOError

antoine.pitrou python-checkins at python.org
Wed Oct 12 19:14:03 CEST 2011


http://hg.python.org/cpython/rev/aa6bede69d64
changeset:   72891:aa6bede69d64
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Wed Oct 12 19:10:10 2011 +0200
summary:
  Fix some mentions of IOError

files:
  Doc/library/chunk.rst          |  5 +++--
  Doc/library/fileinput.rst      |  5 ++++-
  Doc/library/signal.rst         |  8 ++++++--
  Doc/library/urllib.request.rst |  2 +-
  4 files changed, 14 insertions(+), 6 deletions(-)


diff --git a/Doc/library/chunk.rst b/Doc/library/chunk.rst
--- a/Doc/library/chunk.rst
+++ b/Doc/library/chunk.rst
@@ -84,8 +84,9 @@
       Close and skip to the end of the chunk.  This does not close the
       underlying file.
 
-   The remaining methods will raise :exc:`IOError` if called after the
-   :meth:`close` method has been called.
+   The remaining methods will raise :exc:`OSError` if called after the
+   :meth:`close` method has been called.  Before Python 3.3, they used to
+   raise :exc:`IOError`, now an alias of :exc:`OSError`.
 
 
    .. method:: isatty()
diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst
--- a/Doc/library/fileinput.rst
+++ b/Doc/library/fileinput.rst
@@ -28,7 +28,10 @@
 All files are opened in text mode by default, but you can override this by
 specifying the *mode* parameter in the call to :func:`.input` or
 :class:`FileInput`.  If an I/O error occurs during opening or reading a file,
-:exc:`IOError` is raised.
+:exc:`OSError` is raised.
+
+.. versionchanged:: 3.3
+   :exc:`IOError` used to be raised; it is now an alias of :exc:`OSError`.
 
 If ``sys.stdin`` is used more than once, the second and further use will return
 no lines, except perhaps for interactive use, or if it has been explicitly reset
diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst
--- a/Doc/library/signal.rst
+++ b/Doc/library/signal.rst
@@ -145,7 +145,11 @@
    Raised to signal an error from the underlying :func:`setitimer` or
    :func:`getitimer` implementation. Expect this error if an invalid
    interval timer or a negative time is passed to :func:`setitimer`.
-   This error is a subtype of :exc:`IOError`.
+   This error is a subtype of :exc:`OSError`.
+
+   .. versionadded:: 3.3
+      This error used to be a subtype of :exc:`IOError`, which is now an
+      alias of :exc:`OSError`.
 
 
 The :mod:`signal` module defines the following functions:
@@ -396,7 +400,7 @@
 
    def handler(signum, frame):
        print('Signal handler called with signal', signum)
-       raise IOError("Couldn't open device!")
+       raise OSError("Couldn't open device!")
 
    # Set the signal handler and a 5-second alarm
    signal.signal(signal.SIGALRM, handler)
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst
--- a/Doc/library/urllib.request.rst
+++ b/Doc/library/urllib.request.rst
@@ -1172,7 +1172,7 @@
    *key_file* and *cert_file* are supported to provide an  SSL key and certificate;
    both are needed to support client authentication.
 
-   :class:`URLopener` objects will raise an :exc:`IOError` exception if the server
+   :class:`URLopener` objects will raise an :exc:`OSError` exception if the server
    returns an error code.
 
     .. method:: open(fullurl, data=None)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list