]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-151941: Fix Sphinx reference warnings in `Doc/c-api/` (GH-152044)
authorAniket <148300120+Aniketsy@users.noreply.github.com>
Thu, 30 Jul 2026 12:48:38 +0000 (18:18 +0530)
committerGitHub <noreply@github.com>
Thu, 30 Jul 2026 12:48:38 +0000 (08:48 -0400)
Doc/c-api/exceptions.rst
Doc/c-api/init_config.rst
Doc/c-api/intro.rst
Doc/tools/.nitignore
Tools/check-c-api-docs/ignored_c_api.txt

index d04074f6e6a79930bed766522ebf47084ce8dc50..40522f8c7b1375622f5acde523340b44338645df 100644 (file)
@@ -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
 ==================
 
index d6b9837987a39990b465e1ce8e66e3572d55e551..ef09639189a6c275695e5c0d7fe5471aa84bd0e5 100644 (file)
@@ -1235,9 +1235,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``.
 
@@ -1748,7 +1748,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
@@ -1984,8 +1984,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.
index 4c0c9af45e8360dedb2f26c39187010e626390c4..701d2a31b8c9059475afd4a8377bbd8cbd67815d 100644 (file)
@@ -1163,7 +1163,7 @@ when defined by the compiler, will also implicitly enable :c:macro:`!Py_DEBUG`.
 In addition to the reference count debugging described below, extra checks are
 performed. See :ref:`Python Debug Build <debug-build>` for more details.
 
-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
index ab592cfa5a1bbbd286c87f04a6a4981fc38aebe5..6a4ab9f5aa3bf6549819eb787f9790bc93fec66e 100644 (file)
@@ -2,9 +2,6 @@
 # as tested on the CI via check-warnings.py in reusable-docs.yml.
 # Keep lines sorted lexicographically to help avoid merge conflicts.
 
-Doc/c-api/init_config.rst
-Doc/c-api/intro.rst
-Doc/c-api/stable.rst
 Doc/library/ast.rst
 Doc/library/asyncio-extending.rst
 Doc/library/email.charset.rst
index aeae9e6553a3aa68ce966e9ca07fe86d02e13bba..af7b2772ef5e08554923e754bd95a10442a4fdea 100644 (file)
@@ -37,8 +37,6 @@ PyWrapperFlag_KEYWORDS
 Py_UniversalNewlineFgets
 # cpython/pylifecycle.h
 Py_FrozenMain
-# pythonrun.h
-PyErr_Display
 # cpython/objimpl.h
 PyObject_GET_WEAKREFS_LISTPTR
 # cpython/pythonrun.h