summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-07-28 10:35:20 (GMT)
committerGitHub <noreply@github.com>2023-07-28 10:35:20 (GMT)
commit0f42f41ea804e76bdb72c012d13b45a048e46c36 (patch)
tree0dc8017d3e745317ee2912bc80f723c250dd6a5d /Doc/library
parent3f167de440f65eb03f795e33b98cf3e84627e213 (diff)
downloadcpython-0f42f41ea804e76bdb72c012d13b45a048e46c36.zip
cpython-0f42f41ea804e76bdb72c012d13b45a048e46c36.tar.gz
cpython-0f42f41ea804e76bdb72c012d13b45a048e46c36.tar.bz2
[3.12] gh-107091: Fix some uses of :const: role (GH-107379) (GH-107384)
It is for references, not for literals. (cherry picked from commit 0aa58fa7a62cd0ee7ec27fa87122425aeff0467d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/fcntl.rst6
-rw-r--r--Doc/library/fractions.rst2
-rw-r--r--Doc/library/logging.handlers.rst4
-rw-r--r--Doc/library/os.rst4
-rw-r--r--Doc/library/signal.rst2
-rw-r--r--Doc/library/ssl.rst2
-rw-r--r--Doc/library/subprocess.rst10
-rw-r--r--Doc/library/sys.rst8
8 files changed, 19 insertions, 19 deletions
diff --git a/Doc/library/fcntl.rst b/Doc/library/fcntl.rst
index 5a27646..969a79f 100644
--- a/Doc/library/fcntl.rst
+++ b/Doc/library/fcntl.rst
@@ -172,9 +172,9 @@ The module defines the following functions:
which the lock starts, relative to *whence*, and *whence* is as with
:func:`io.IOBase.seek`, specifically:
- * :const:`0` -- relative to the start of the file (:const:`os.SEEK_SET`)
- * :const:`1` -- relative to the current buffer position (:const:`os.SEEK_CUR`)
- * :const:`2` -- relative to the end of the file (:const:`os.SEEK_END`)
+ * ``0`` -- relative to the start of the file (:const:`os.SEEK_SET`)
+ * ``1`` -- relative to the current buffer position (:const:`os.SEEK_CUR`)
+ * ``2`` -- relative to the end of the file (:const:`os.SEEK_END`)
The default for *start* is 0, which means to start at the beginning of the file.
The default for *len* is 0 which means to lock to the end of the file. The
diff --git a/Doc/library/fractions.rst b/Doc/library/fractions.rst
index fe2e8ab..509c636 100644
--- a/Doc/library/fractions.rst
+++ b/Doc/library/fractions.rst
@@ -25,7 +25,7 @@ another rational number, or from a string.
The first version requires that *numerator* and *denominator* are instances
of :class:`numbers.Rational` and returns a new :class:`Fraction` instance
- with value ``numerator/denominator``. If *denominator* is :const:`0`, it
+ with value ``numerator/denominator``. If *denominator* is ``0``, it
raises a :exc:`ZeroDivisionError`. The second version requires that
*other_fraction* is an instance of :class:`numbers.Rational` and returns a
:class:`Fraction` instance with the same value. The next two versions accept
diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst
index 72e5ffb..2a825db 100644
--- a/Doc/library/logging.handlers.rst
+++ b/Doc/library/logging.handlers.rst
@@ -97,7 +97,7 @@ sends logging output to a disk file. It inherits the output functionality from
Returns a new instance of the :class:`FileHandler` class. The specified file is
opened and used as the stream for logging. If *mode* is not specified,
- :const:`'a'` is used. If *encoding* is not ``None``, it is used to open the file
+ ``'a'`` is used. If *encoding* is not ``None``, it is used to open the file
with that encoding. If *delay* is true, then file opening is deferred until the
first call to :meth:`emit`. By default, the file grows indefinitely. If
*errors* is specified, it's used to determine how encoding errors are handled.
@@ -182,7 +182,7 @@ for this value.
Returns a new instance of the :class:`WatchedFileHandler` class. The specified
file is opened and used as the stream for logging. If *mode* is not specified,
- :const:`'a'` is used. If *encoding* is not ``None``, it is used to open the file
+ ``'a'`` is used. If *encoding* is not ``None``, it is used to open the file
with that encoding. If *delay* is true, then file opening is deferred until the
first call to :meth:`emit`. By default, the file grows indefinitely. If
*errors* is provided, it determines how encoding errors are handled.
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 956eeff..9735baa 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -401,11 +401,11 @@ process and user.
On macOS, :func:`getgroups` behavior differs somewhat from
other Unix platforms. If the Python interpreter was built with a
- deployment target of :const:`10.5` or earlier, :func:`getgroups` returns
+ deployment target of ``10.5`` or earlier, :func:`getgroups` returns
the list of effective group ids associated with the current user process;
this list is limited to a system-defined number of entries, typically 16,
and may be modified by calls to :func:`setgroups` if suitably privileged.
- If built with a deployment target greater than :const:`10.5`,
+ If built with a deployment target greater than ``10.5``,
:func:`getgroups` returns the current group access list for the user
associated with the effective user id of the process; the group access
list may change over the lifetime of the process, it is not affected by
diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst
index e53315b..7ee5ece 100644
--- a/Doc/library/signal.rst
+++ b/Doc/library/signal.rst
@@ -656,7 +656,7 @@ The :mod:`signal` module defines the following functions:
.. function:: sigtimedwait(sigset, timeout)
Like :func:`sigwaitinfo`, but takes an additional *timeout* argument
- specifying a timeout. If *timeout* is specified as :const:`0`, a poll is
+ specifying a timeout. If *timeout* is specified as ``0``, a poll is
performed. Returns :const:`None` if a timeout occurs.
.. availability:: Unix.
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index 1f8bbe1..5d6bc82 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -320,7 +320,7 @@ Random generation
Mix the given *bytes* into the SSL pseudo-random number generator. The
parameter *entropy* (a float) is a lower bound on the entropy contained in
- string (so you can always use :const:`0.0`). See :rfc:`1750` for more
+ string (so you can always use ``0.0``). See :rfc:`1750` for more
information on sources of entropy.
.. versionchanged:: 3.5
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index db05cb2..04340cc 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -465,9 +465,9 @@ functions.
:func:`open` function when creating the stdin/stdout/stderr pipe
file objects:
- - :const:`0` means unbuffered (read and write are one
+ - ``0`` means unbuffered (read and write are one
system call and can return short)
- - :const:`1` means line buffered
+ - ``1`` means line buffered
(only usable if ``text=True`` or ``universal_newlines=True``)
- any other positive value means use a buffer of approximately that
size
@@ -477,7 +477,7 @@ functions.
.. versionchanged:: 3.3.1
*bufsize* now defaults to -1 to enable buffering by default to match the
behavior that most code expects. In versions prior to Python 3.2.4 and
- 3.3.1 it incorrectly defaulted to :const:`0` which was unbuffered
+ 3.3.1 it incorrectly defaulted to ``0`` which was unbuffered
and allowed short reads. This was unintentional and did not match the
behavior of Python 2 as most code expected.
@@ -541,8 +541,8 @@ functions.
:exc:`RuntimeError`. The new restriction may affect applications that
are deployed in mod_wsgi, uWSGI, and other embedded environments.
- If *close_fds* is true, all file descriptors except :const:`0`, :const:`1` and
- :const:`2` will be closed before the child process is executed. Otherwise
+ If *close_fds* is true, all file descriptors except ``0``, ``1`` and
+ ``2`` will be closed before the child process is executed. Otherwise
when *close_fds* is false, file descriptors obey their inheritable flag
as described in :ref:`fd_inheritance`.
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index f6b67dc..a617373 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -877,19 +877,19 @@ always available.
``sys.getwindowsversion().major``. For compatibility with prior
versions, only the first 5 elements are retrievable by indexing.
- *platform* will be :const:`2 (VER_PLATFORM_WIN32_NT)`.
+ *platform* will be ``2`` (VER_PLATFORM_WIN32_NT).
*product_type* may be one of the following values:
+---------------------------------------+---------------------------------+
| Constant | Meaning |
+=======================================+=================================+
- | :const:`1 (VER_NT_WORKSTATION)` | The system is a workstation. |
+ | ``1`` (VER_NT_WORKSTATION) | The system is a workstation. |
+---------------------------------------+---------------------------------+
- | :const:`2 (VER_NT_DOMAIN_CONTROLLER)` | The system is a domain |
+ | ``2`` (VER_NT_DOMAIN_CONTROLLER) | The system is a domain |
| | controller. |
+---------------------------------------+---------------------------------+
- | :const:`3 (VER_NT_SERVER)` | The system is a server, but not |
+ | ``3`` (VER_NT_SERVER) | The system is a server, but not |
| | a domain controller. |
+---------------------------------------+---------------------------------+