Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.12] gh-107091: Fix some uses of :const: role (GH-107379) #107384

Merged
merged 1 commit into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Doc/library/fcntl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

----------------

This module performs file control and I/O control on file descriptors. It is an

Check warning on line 16 in Doc/library/fcntl.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

c:func reference target not found: ioctl
interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines. For a
complete description of these calls, see :manpage:`fcntl(2)` and
:manpage:`ioctl(2)` Unix manual pages.
Expand Down Expand Up @@ -118,7 +118,7 @@
buffer 1024 bytes long which is then passed to :func:`ioctl` and copied back
into the supplied buffer.

If the :c:func:`ioctl` fails, an :exc:`OSError` exception is raised.

Check warning on line 121 in Doc/library/fcntl.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

c:func reference target not found: ioctl

An example::

Expand All @@ -143,7 +143,7 @@
:manpage:`flock(2)` for details. (On some systems, this function is emulated
using :c:func:`fcntl`.)

If the :c:func:`flock` fails, an :exc:`OSError` exception is raised.

Check warning on line 146 in Doc/library/fcntl.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

c:func reference target not found: flock

.. audit-event:: fcntl.flock fd,operation fcntl.flock

Expand All @@ -155,11 +155,11 @@
method are accepted as well) of the file to lock or unlock, and *cmd*
is one of the following values:

* :const:`LOCK_UN` -- unlock

Check warning on line 158 in Doc/library/fcntl.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:const reference target not found: LOCK_UN
* :const:`LOCK_SH` -- acquire a shared lock

Check warning on line 159 in Doc/library/fcntl.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:const reference target not found: LOCK_SH
* :const:`LOCK_EX` -- acquire an exclusive lock

Check warning on line 160 in Doc/library/fcntl.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:const reference target not found: LOCK_EX

When *cmd* is :const:`LOCK_SH` or :const:`LOCK_EX`, it can also be

Check warning on line 162 in Doc/library/fcntl.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:const reference target not found: LOCK_SH

Check warning on line 162 in Doc/library/fcntl.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:const reference target not found: LOCK_EX

Check warning on line 162 in Doc/library/fcntl.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:const reference target not found: LOCK_NB

Check warning on line 162 in Doc/library/fcntl.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:const reference target not found: LOCK_NB
bitwise ORed with :const:`LOCK_NB` to avoid blocking on lock acquisition.
If :const:`LOCK_NB` is used and the lock cannot be acquired, an
:exc:`OSError` will be raised and the exception will have an *errno*
Expand All @@ -172,9 +172,9 @@
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
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/fractions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/logging.handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/signal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/ssl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions Doc/library/subprocess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down Expand Up @@ -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`.

Expand Down
8 changes: 4 additions & 4 deletions Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
+---------------------------------------+---------------------------------+

Expand Down
1 change: 0 additions & 1 deletion Doc/tools/.nitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ Doc/library/faulthandler.rst
Doc/library/fcntl.rst
Doc/library/filecmp.rst
Doc/library/fileinput.rst
Doc/library/fractions.rst
Doc/library/ftplib.rst
Doc/library/functions.rst
Doc/library/functools.rst
Expand Down
20 changes: 10 additions & 10 deletions Doc/whatsnew/3.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1135,20 +1135,20 @@ API changes
* The C module has the following context limits, depending on the machine
architecture:

+-------------------+---------------------+------------------------------+
| | 32-bit | 64-bit |
+===================+=====================+==============================+
| :const:`MAX_PREC` | :const:`425000000` | :const:`999999999999999999` |
+-------------------+---------------------+------------------------------+
| :const:`MAX_EMAX` | :const:`425000000` | :const:`999999999999999999` |
+-------------------+---------------------+------------------------------+
| :const:`MIN_EMIN` | :const:`-425000000` | :const:`-999999999999999999` |
+-------------------+---------------------+------------------------------+
+-------------------+----------------+-------------------------+
| | 32-bit | 64-bit |
+===================+================+=========================+
| :const:`MAX_PREC` | ``425000000`` | ``999999999999999999`` |
+-------------------+----------------+-------------------------+
| :const:`MAX_EMAX` | ``425000000`` | ``999999999999999999`` |
+-------------------+----------------+-------------------------+
| :const:`MIN_EMIN` | ``-425000000`` | ``-999999999999999999`` |
+-------------------+----------------+-------------------------+

* In the context templates (:class:`~decimal.DefaultContext`,
:class:`~decimal.BasicContext` and :class:`~decimal.ExtendedContext`)
the magnitude of :attr:`~decimal.Context.Emax` and
:attr:`~decimal.Context.Emin` has changed to :const:`999999`.
:attr:`~decimal.Context.Emin` has changed to ``999999``.

* The :class:`~decimal.Decimal` constructor in decimal.py does not observe
the context limits and converts values with arbitrary exponents or precision
Expand Down
Loading