https://github.com/python/cpython/commit/3972524c3f28ce03a456410709507092310ff281
commit: 3972524c3f28ce03a456410709507092310ff281
branch: 3.14
author: Peter Bierma <[email protected]>
committer: ZeroIntensity <[email protected]>
date: 2026-07-30T13:02:06Z
summary:

[3.14] gh-151941: Fix Sphinx reference warnings in `Doc/c-api/` (GH-152044) 
(GH-154921)

(cherry picked from commit b3be16db02e71368774aab62c8ce3f6fb8cc5452)

Co-authored-by: Aniket <[email protected]>

files:
M Doc/c-api/exceptions.rst
M Doc/c-api/init_config.rst
M Doc/c-api/intro.rst
M Doc/tools/.nitignore
M Tools/check-c-api-docs/ignored_c_api.txt

diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst
index 4ff7122fe3f93d6..b9fc7af992026a7 100644
--- a/Doc/c-api/exceptions.rst
+++ b/Doc/c-api/exceptions.rst
@@ -119,6 +119,21 @@ Printing and clearing
    .. versionadded:: 3.12
 
 
+.. c:function:: void PyErr_Display(PyObject *unused, PyObject *value, PyObject 
*tb)
+
+   Legacy variant of :c:func:`PyErr_DisplayException`.
+
+   Print the exception *value* with its traceback to :data:`sys.stderr`.
+   If *value* has no traceback set, *tb* is used as its traceback.
+   The first argument is ignored.
+
+   If :data:`sys.stderr` is ``None``, nothing is printed.
+   If :data:`sys.stderr` is not set, the exception is dumped to the
+   C ``stderr`` stream instead.
+
+   .. deprecated:: 3.12
+      Use :c:func:`PyErr_DisplayException` instead.
+
 Raising exceptions
 ==================
 
diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst
index 487e8491f1153c2..1ee00f28ffd29e9 100644
--- a/Doc/c-api/init_config.rst
+++ b/Doc/c-api/init_config.rst
@@ -1237,9 +1237,9 @@ PyConfig
 
    .. c:member:: wchar_t* base_executable
 
-      Python base executable: :data:`sys._base_executable`.
+      Python base executable: ``sys._base_executable``.
 
-      Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable.
+      Set by the ``__PYVENV_LAUNCHER__`` environment variable.
 
       Set from :c:member:`PyConfig.executable` if ``NULL``.
 
@@ -1745,7 +1745,7 @@ PyConfig
 
       * On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set.
       * If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use
-        :envvar:`__PYVENV_LAUNCHER__` environment variable if set.
+        ``__PYVENV_LAUNCHER__`` environment variable if set.
       * Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and
         non-empty.
       * Otherwise, use ``L"python"`` on Windows, or ``L"python3"`` on other
@@ -1981,8 +1981,7 @@ PyConfig
 
       The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse
       order: the last :c:member:`PyConfig.warnoptions` item becomes the first
-      item of :data:`warnings.filters` which is checked first (highest
-      priority).
+      item of ``warnings.filters`` which is checked first (highest priority).
 
       The :option:`-W` command line options adds its value to
       :c:member:`~PyConfig.warnoptions`, it can be used multiple times.
diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst
index 94abb9fdb50ac2d..fd025999db9d9c2 100644
--- a/Doc/c-api/intro.rst
+++ b/Doc/c-api/intro.rst
@@ -1073,7 +1073,7 @@ in the Unix build, compiler optimization is disabled.
 In addition to the reference count debugging described below, extra checks are
 performed, see :ref:`Python Debug Build <debug-build>`.
 
-Defining :c:macro:`Py_TRACE_REFS` enables reference tracing
+Defining ``Py_TRACE_REFS`` enables reference tracing
 (see the :option:`configure --with-trace-refs option <--with-trace-refs>`).
 When defined, a circular doubly linked list of active objects is maintained by 
adding two extra
 fields to every :c:type:`PyObject`.  Total allocations are tracked as well.  
Upon
diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore
index 706929e9fefe4a5..41ab2d894a45dbe 100644
--- a/Doc/tools/.nitignore
+++ b/Doc/tools/.nitignore
@@ -3,10 +3,7 @@
 # Keep lines sorted lexicographically to help avoid merge conflicts.
 
 Doc/c-api/float.rst
-Doc/c-api/init_config.rst
-Doc/c-api/intro.rst
 Doc/c-api/module.rst
-Doc/c-api/stable.rst
 Doc/library/ast.rst
 Doc/library/asyncio-extending.rst
 Doc/library/email.charset.rst
diff --git a/Tools/check-c-api-docs/ignored_c_api.txt 
b/Tools/check-c-api-docs/ignored_c_api.txt
index 642a1e07f745cd6..3c8400a9b3c75a7 100644
--- a/Tools/check-c-api-docs/ignored_c_api.txt
+++ b/Tools/check-c-api-docs/ignored_c_api.txt
@@ -60,8 +60,6 @@ PyWrapperFlag_KEYWORDS
 Py_UniversalNewlineFgets
 # cpython/pylifecycle.h
 Py_FrozenMain
-# pythonrun.h
-PyErr_Display
 # cpython/objimpl.h
 PyObject_GET_WEAKREFS_LISTPTR
 # cpython/pythonrun.h

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to