From cfccca3a5cc28a1ebe67564944f2fac4b965a36d Mon Sep 17 00:00:00 2001 From: Aniket Singh Yadav Date: Wed, 24 Jun 2026 05:25:23 +0000 Subject: [PATCH 1/4] Doc: fix Sphinx reference warnings in Doc/c-api/ --- Doc/c-api/init_config.rst | 9 ++++----- Doc/c-api/intro.rst | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst index d6b9837987a3999..0455d8b22325359 100644 --- a/Doc/c-api/init_config.rst +++ b/Doc/c-api/init_config.rst @@ -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 :attr:`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 500f2818e2e40a6..c0eb56910e76222 100644 --- a/Doc/c-api/intro.rst +++ b/Doc/c-api/intro.rst @@ -1160,7 +1160,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 ` 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 From 9d610be6c8fcbc0fe2178289581b24e77560e1c5 Mon Sep 17 00:00:00 2001 From: Aniket Singh Yadav Date: Wed, 24 Jun 2026 07:55:00 +0000 Subject: [PATCH 2/4] Remove Doc/c-api/intro.rst from nitignore --- Doc/tools/.nitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore index 2255c745c003838..93cc2172ffa661d 100644 --- a/Doc/tools/.nitignore +++ b/Doc/tools/.nitignore @@ -3,7 +3,6 @@ # 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 From 22b90f8cc5c6d2f1a5482c557815ca69c4793f36 Mon Sep 17 00:00:00 2001 From: Aniket Singh Yadav Date: Wed, 8 Jul 2026 16:58:25 +0000 Subject: [PATCH 3/4] Fix broken Sphinx references in Doc/c-api/ --- Doc/c-api/init_config.rst | 2 +- Doc/tools/.nitignore | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst index 0455d8b22325359..ef09639189a6c27 100644 --- a/Doc/c-api/init_config.rst +++ b/Doc/c-api/init_config.rst @@ -1984,7 +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 :attr:`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/tools/.nitignore b/Doc/tools/.nitignore index 93cc2172ffa661d..77bbb9cda5105e3 100644 --- a/Doc/tools/.nitignore +++ b/Doc/tools/.nitignore @@ -2,8 +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/stable.rst Doc/library/ast.rst Doc/library/asyncio-extending.rst Doc/library/email.charset.rst From 468d2101f0f776c5b0ccc1708aaf365a1ff7d679 Mon Sep 17 00:00:00 2001 From: Aniket Singh Yadav Date: Sat, 11 Jul 2026 09:46:39 +0000 Subject: [PATCH 4/4] Fix Sphinx nitpick warnings in C API docs --- Doc/c-api/exceptions.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 82f594e11300a7d..21a67eb52a1532d 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 ==================