Skip to content

Commit 6b63d40

Browse files
[3.11] gh-110497: Add note about OSError being an alias to IOError in docs (GH-110498) (#110545)
gh-110497: Add note about `OSError` being an alias to `IOError` in docs (GH-110498) (cherry picked from commit 5e7edac) Co-authored-by: Nikita Sobolev <[email protected]>
1 parent 2bad6e7 commit 6b63d40

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

Doc/library/ctypes.rst

+5-3
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,8 @@ way is to instantiate one of the following classes:
13741374
failure, an :class:`OSError` is automatically raised.
13751375

13761376
.. versionchanged:: 3.3
1377-
:exc:`WindowsError` used to be raised.
1377+
:exc:`WindowsError` used to be raised,
1378+
which is now an alias of :exc:`OSError`.
13781379

13791380

13801381
.. class:: WinDLL(name, mode=DEFAULT_MODE, handle=None, use_errno=False, use_last_error=False, winmode=None)
@@ -2047,13 +2048,14 @@ Utility functions
20472048
.. function:: WinError(code=None, descr=None)
20482049

20492050
Windows only: this function is probably the worst-named thing in ctypes. It
2050-
creates an instance of OSError. If *code* is not specified,
2051+
creates an instance of :exc:`OSError`. If *code* is not specified,
20512052
``GetLastError`` is called to determine the error code. If *descr* is not
20522053
specified, :func:`FormatError` is called to get a textual description of the
20532054
error.
20542055

20552056
.. versionchanged:: 3.3
2056-
An instance of :exc:`WindowsError` used to be created.
2057+
An instance of :exc:`WindowsError` used to be created, which is now an
2058+
alias of :exc:`OSError`.
20572059

20582060

20592061
.. function:: wstring_at(address, size=-1)

Doc/library/gettext.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ install themselves in the built-in namespace as the function :func:`!_`.
167167
:class:`NullTranslations` instance if *fallback* is true.
168168

169169
.. versionchanged:: 3.3
170-
:exc:`IOError` used to be raised instead of :exc:`OSError`.
170+
:exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`.
171171

172172
.. versionchanged:: 3.11
173173
*codeset* parameter is removed.

Doc/library/http.cookiejar.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ The module defines the following exception:
4444
cookies from a file. :exc:`LoadError` is a subclass of :exc:`OSError`.
4545

4646
.. versionchanged:: 3.3
47-
LoadError was made a subclass of :exc:`OSError` instead of
48-
:exc:`IOError`.
47+
:exc:`LoadError` used to be a subtype of :exc:`IOError`, which is now an
48+
alias of :exc:`OSError`.
4949

5050

5151
The following classes are provided:

Doc/library/urllib.error.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ The following exceptions are raised by :mod:`urllib.error` as appropriate:
2727
exception instance.
2828

2929
.. versionchanged:: 3.3
30-
:exc:`URLError` has been made a subclass of :exc:`OSError` instead
31-
of :exc:`IOError`.
30+
:exc:`URLError` used to be a subtype of :exc:`IOError`, which is now an
31+
alias of :exc:`OSError`.
3232

3333

3434
.. exception:: HTTPError

Doc/library/zipimport.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ zipimporter Objects
130130
file wasn't found.
131131

132132
.. versionchanged:: 3.3
133-
:exc:`IOError` used to be raised instead of :exc:`OSError`.
133+
:exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`.
134134

135135

136136
.. method:: get_filename(fullname)

0 commit comments

Comments
 (0)