Skip to content

Commit dbd0d9b

Browse files
authored
Soft-deprecate C-API OSError aliases (GH-160111)
1 parent 0a86a34 commit dbd0d9b

2 files changed

Lines changed: 27 additions & 28 deletions

File tree

‎Doc/c-api/exceptions.rst‎

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,34 +1340,30 @@ Exception types
13401340
OSError aliases
13411341
---------------
13421342
1343-
The following are a compatibility aliases to :c:data:`PyExc_OSError`.
1344-
1345-
.. versionchanged:: 3.3
1346-
These aliases used to be separate exception types.
1347-
1348-
.. list-table::
1349-
:align: left
1350-
:widths: auto
1351-
:header-rows: 1
1352-
1353-
* * C name
1354-
* Python name
1355-
* Notes
1356-
* * .. c:var:: PyObject *PyExc_EnvironmentError
1357-
* :exc:`OSError`
1358-
*
1359-
* * .. c:var:: PyObject *PyExc_IOError
1360-
* :exc:`OSError`
1361-
*
1362-
* * .. c:var:: PyObject *PyExc_WindowsError
1363-
* :exc:`OSError`
1364-
* [win]_
1365-
1366-
Notes:
1367-
1368-
.. [win]
1369-
:c:var:`!PyExc_WindowsError` is only defined on Windows; protect code that
1370-
uses this by testing that the preprocessor macro ``MS_WINDOWS`` is defined.
1343+
The following are :term:`soft deprecated` compatibility aliases
1344+
to :c:data:`PyExc_OSError`.
1345+
1346+
.. stable-abi-note::
1347+
1348+
These pointers are part of the :ref:`Stable ABI <stable>` since the
1349+
version in the *S.ABI* column (or since 3.2 when *S.ABI* is empty).
1350+
1351+
.. c:var:: PyObject *PyExc_EnvironmentError
1352+
1353+
.. soft-deprecated:: next
1354+
Use :c:data:`PyExc_OSError` instead.
1355+
1356+
.. c:var:: PyObject *PyExc_IOError
1357+
1358+
.. soft-deprecated:: next
1359+
Use :c:data:`PyExc_OSError` instead.
1360+
1361+
.. c:var:: PyObject *PyExc_WindowsError
1362+
1363+
.. availability:: Windows
1364+
1365+
.. soft-deprecated:: next
1366+
Use :c:data:`PyExc_OSError` instead.
13711367
13721368
13731369
.. _standardwarningcategories:

‎Doc/tools/removed-ids.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,6 @@ library/turtle.html: introduction
121121
# Wrong exception names in 'concurrent.interpreters' docs (gh-136563)
122122
library/concurrent.interpreters.html: concurrent.interpreters.QueueEmptyError
123123
library/concurrent.interpreters.html: concurrent.interpreters.QueueFullError
124+
125+
# Removed footnote
126+
c-api/exceptions.html: win

0 commit comments

Comments
 (0)