From 1527f1177041ccd488382b27c58783192831540b Mon Sep 17 00:00:00 2001 From: Harjoth Khara Date: Wed, 28 Oct 2026 05:25:33 -0700 Subject: [PATCH] gh-151950: Fix Sphinx reference warnings in termios docs (GH-153885) Document the VMIN/VTIME, TCIFLUSH/TCOFLUSH/TCIOFLUSH, TCOOFF/TCOON/TCIOFF/TCION and TIOC* window-size constants with ``.. data::`` directives so the ``:const:`` references resolve, and drop termios.rst from Doc/tools/.nitignore. (cherry picked from commit 312222feebbcf574b5f1759ac8ae75762f2e8b4e) Co-authored-by: Harjoth Khara Co-authored-by: Claude Sonnet 5.5 --- Doc/library/termios.rst | 34 ++++++++++++++++++++++++++++++++++ Doc/tools/.nitignore | 1 - 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/Doc/library/termios.rst b/Doc/library/termios.rst index 537dfcedd8cf5a..1db8ec0b6a341f 100644 --- a/Doc/library/termios.rst +++ b/Doc/library/termios.rst @@ -39,6 +39,13 @@ The module defines the following functions: well as the indexing in the *cc* array must be done using the symbolic constants defined in the :mod:`!termios` module. + .. data:: VMIN + VTIME + + Indices into the *cc* array controlling a non-canonical read: the minimum + number of characters to read and the timeout in tenths of a second, + respectively. + .. function:: tcsetattr(fd, when, attributes) @@ -77,6 +84,13 @@ The module defines the following functions: which queue: :const:`TCIFLUSH` for the input queue, :const:`TCOFLUSH` for the output queue, or :const:`TCIOFLUSH` for both queues. + .. data:: TCIFLUSH + TCOFLUSH + TCIOFLUSH + + Values for the *queue* selector: the input queue, the output queue, or + both queues, respectively. + .. function:: tcflow(fd, action) @@ -84,6 +98,14 @@ The module defines the following functions: argument can be :const:`TCOOFF` to suspend output, :const:`TCOON` to restart output, :const:`TCIOFF` to suspend input, or :const:`TCION` to restart input. + .. data:: TCOOFF + TCOON + TCIOFF + TCION + + Values for the *action* argument: suspend output, restart output, + suspend input, or restart input, respectively. + .. function:: tcgetwinsize(fd) @@ -93,6 +115,12 @@ The module defines the following functions: .. versionadded:: 3.11 + .. data:: TIOCGWINSZ + TIOCGSIZE + + ``ioctl()`` requests for querying the tty window size. Not defined on + all platforms; :func:`tcgetwinsize` requires at least one of them. + .. function:: tcsetwinsize(fd, winsize) @@ -104,6 +132,12 @@ The module defines the following functions: .. versionadded:: 3.11 + .. data:: TIOCSWINSZ + TIOCSSIZE + + ``ioctl()`` requests for setting the tty window size. Not defined on all + platforms; see :func:`tcsetwinsize` for the required pairs. + .. seealso:: diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore index 157f7451e5a0d5..f0cd9c65f41309 100644 --- a/Doc/tools/.nitignore +++ b/Doc/tools/.nitignore @@ -16,7 +16,6 @@ Doc/library/pyexpat.rst Doc/library/select.rst Doc/library/socket.rst Doc/library/ssl.rst -Doc/library/termios.rst Doc/library/urllib.parse.rst Doc/library/urllib.request.rst Doc/library/wsgiref.rst