Soft-deprecate C-API OSError aliases (GH-160111)

This commit is contained in:
Petr Viktorin authored and GitHub committed 2026-10-21 23:48:53 +02:00
1 parent 0a86a343f0
commit dbd0d9b8a9
2 files changed
+22 -23

No files matched your search

+19 -23
View File
@@ -1340,34 +1340,30 @@ Exception types
OSError aliases
---------------
The following are a compatibility aliases to :c:data:`PyExc_OSError`.
The following are :term:`soft deprecated` compatibility aliases
to :c:data:`PyExc_OSError`.
.. versionchanged:: 3.3
These aliases used to be separate exception types.
.. stable-abi-note::
.. list-table::
:align: left
:widths: auto
:header-rows: 1
These pointers are part of the :ref:`Stable ABI <stable>` since the
version in the *S.ABI* column (or since 3.2 when *S.ABI* is empty).
* * C name
* Python name
* Notes
* * .. c:var:: PyObject *PyExc_EnvironmentError
* :exc:`OSError`
*
* * .. c:var:: PyObject *PyExc_IOError
* :exc:`OSError`
*
* * .. c:var:: PyObject *PyExc_WindowsError
* :exc:`OSError`
* [win]_
.. c:var:: PyObject *PyExc_EnvironmentError
Notes:
.. soft-deprecated:: next
Use :c:data:`PyExc_OSError` instead.
.. [win]
:c:var:`!PyExc_WindowsError` is only defined on Windows; protect code that
uses this by testing that the preprocessor macro ``MS_WINDOWS`` is defined.
.. c:var:: PyObject *PyExc_IOError
.. soft-deprecated:: next
Use :c:data:`PyExc_OSError` instead.
.. c:var:: PyObject *PyExc_WindowsError
.. availability:: Windows
.. soft-deprecated:: next
Use :c:data:`PyExc_OSError` instead.
.. _standardwarningcategories:
+3
View File
@@ -121,3 +121,6 @@ library/turtle.html: introduction
# Wrong exception names in 'concurrent.interpreters' docs (gh-136563)
library/concurrent.interpreters.html: concurrent.interpreters.QueueEmptyError
library/concurrent.interpreters.html: concurrent.interpreters.QueueFullError
# Removed footnote
c-api/exceptions.html: win