From d22503d978744ba1ff18262217065f4f93dc9948 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 21 Oct 2026 13:25:34 -0700 Subject: [PATCH 1/2] Soft-deprecate C-API OSError aliases --- Doc/c-api/exceptions.rst | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 7f4e1ecc2aba26..ef688c0b8956a6 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -1273,34 +1273,25 @@ 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. +.. c:var:: PyObject *PyExc_EnvironmentError -.. list-table:: - :align: left - :widths: auto - :header-rows: 1 + .. soft-deprecated:: next + Use :c:data:`PyExc_OSError` instead. - * * 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_IOError + + .. soft-deprecated:: next + Use :c:data:`PyExc_OSError` instead. + +.. c:var:: PyObject *PyExc_WindowsError -Notes: + .. availability:: Windows -.. [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. + .. soft-deprecated:: next + Use :c:data:`PyExc_OSError` instead. .. _standardwarningcategories: From b8acdf00d2bab6a2944d699087c5dcfb537dcd91 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 21 Oct 2026 14:12:55 -0700 Subject: [PATCH 2/2] Ignore removed footnote target --- Doc/c-api/exceptions.rst | 5 +++++ Doc/tools/removed-ids.txt | 3 +++ 2 files changed, 8 insertions(+) diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 9f84d3d675bf6f..ba4e2a418b2a49 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -1343,6 +1343,11 @@ OSError aliases The following are :term:`soft deprecated` compatibility aliases to :c:data:`PyExc_OSError`. +.. stable-abi-note:: + + These pointers are part of the :ref:`Stable ABI ` since the + version in the *S.ABI* column (or since 3.2 when *S.ABI* is empty). + .. c:var:: PyObject *PyExc_EnvironmentError .. soft-deprecated:: next diff --git a/Doc/tools/removed-ids.txt b/Doc/tools/removed-ids.txt index be3ed35de44855..cc5ec51b541ab3 100644 --- a/Doc/tools/removed-ids.txt +++ b/Doc/tools/removed-ids.txt @@ -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