gh-106909: Use role :const: for referencing module constants (GH-106910)

This commit is contained in:
Serhiy Storchaka 2023-07-21 12:40:37 +03:00 committed by GitHub
parent d036db728e
commit 4b9948617f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
64 changed files with 238 additions and 238 deletions

View file

@ -70,10 +70,10 @@ This module defines the following constants and functions:
there is no guarantee that the interruption will happen immediately.
If given, *signum* is the number of the signal to simulate.
If *signum* is not given, :data:`signal.SIGINT` is simulated.
If *signum* is not given, :const:`signal.SIGINT` is simulated.
If the given signal isn't handled by Python (it was set to
:data:`signal.SIG_DFL` or :data:`signal.SIG_IGN`), this function does
:const:`signal.SIG_DFL` or :const:`signal.SIG_IGN`), this function does
nothing.
.. versionchanged:: 3.10

View file

@ -34,7 +34,7 @@ There are several ways to enable asyncio debug mode:
In addition to enabling the debug mode, consider also:
* setting the log level of the :ref:`asyncio logger <asyncio-logger>` to
:py:data:`logging.DEBUG`, for example the following snippet of code
:py:const:`logging.DEBUG`, for example the following snippet of code
can be run at startup of the application::
logging.basicConfig(level=logging.DEBUG)
@ -142,7 +142,7 @@ Logging
asyncio uses the :mod:`logging` module and all logging is performed
via the ``"asyncio"`` logger.
The default log level is :py:data:`logging.INFO`, which can be easily
The default log level is :py:const:`logging.INFO`, which can be easily
adjusted::
logging.getLogger("asyncio").setLevel(logging.WARNING)

View file

@ -403,11 +403,11 @@ Opening network connections
Open a streaming transport connection to a given
address specified by *host* and *port*.
The socket family can be either :py:data:`~socket.AF_INET` or
:py:data:`~socket.AF_INET6` depending on *host* (or the *family*
The socket family can be either :py:const:`~socket.AF_INET` or
:py:const:`~socket.AF_INET6` depending on *host* (or the *family*
argument, if provided).
The socket type will be :py:data:`~socket.SOCK_STREAM`.
The socket type will be :py:const:`~socket.SOCK_STREAM`.
*protocol_factory* must be a callable returning an
:ref:`asyncio protocol <asyncio-protocol>` implementation.
@ -509,7 +509,7 @@ Opening network connections
.. versionchanged:: 3.6
The socket option :py:data:`~socket.TCP_NODELAY` is set by default
The socket option :py:const:`~socket.TCP_NODELAY` is set by default
for all TCP connections.
.. versionchanged:: 3.7
@ -552,11 +552,11 @@ Opening network connections
Create a datagram connection.
The socket family can be either :py:data:`~socket.AF_INET`,
:py:data:`~socket.AF_INET6`, or :py:data:`~socket.AF_UNIX`,
The socket family can be either :py:const:`~socket.AF_INET`,
:py:const:`~socket.AF_INET6`, or :py:const:`~socket.AF_UNIX`,
depending on *host* (or the *family* argument, if provided).
The socket type will be :py:data:`~socket.SOCK_DGRAM`.
The socket type will be :py:const:`~socket.SOCK_DGRAM`.
*protocol_factory* must be a callable returning a
:ref:`protocol <asyncio-protocol>` implementation.
@ -581,7 +581,7 @@ Opening network connections
* *reuse_port* tells the kernel to allow this endpoint to be bound to the
same port as other existing endpoints are bound to, so long as they all
set this flag when being created. This option is not supported on Windows
and some Unixes. If the :py:data:`~socket.SO_REUSEPORT` constant is not
and some Unixes. If the :py:const:`~socket.SO_REUSEPORT` constant is not
defined then this capability is unsupported.
* *allow_broadcast* tells the kernel to allow this endpoint to send
@ -607,7 +607,7 @@ Opening network connections
.. versionchanged:: 3.8.1
The *reuse_address* parameter is no longer supported, as using
:py:data:`~sockets.SO_REUSEADDR` poses a significant security concern for
:py:const:`~sockets.SO_REUSEADDR` poses a significant security concern for
UDP. Explicitly passing ``reuse_address=True`` will raise an exception.
When multiple processes with differing UIDs assign sockets to an
@ -616,7 +616,7 @@ Opening network connections
For supported platforms, *reuse_port* can be used as a replacement for
similar functionality. With *reuse_port*,
:py:data:`~sockets.SO_REUSEPORT` is used instead, which specifically
:py:const:`~sockets.SO_REUSEPORT` is used instead, which specifically
prevents processes with differing UIDs from assigning sockets to the same
socket address.
@ -634,8 +634,8 @@ Opening network connections
Create a Unix connection.
The socket family will be :py:data:`~socket.AF_UNIX`; socket
type will be :py:data:`~socket.SOCK_STREAM`.
The socket family will be :py:const:`~socket.AF_UNIX`; socket
type will be :py:const:`~socket.SOCK_STREAM`.
A tuple of ``(transport, protocol)`` is returned on success.
@ -671,7 +671,7 @@ Creating network servers
ssl_shutdown_timeout=None, \
start_serving=True)
Create a TCP server (socket type :data:`~socket.SOCK_STREAM`) listening
Create a TCP server (socket type :const:`~socket.SOCK_STREAM`) listening
on *port* of the *host* address.
Returns a :class:`Server` object.
@ -699,10 +699,10 @@ Creating network servers
be selected (note that if *host* resolves to multiple network interfaces,
a different random port will be selected for each interface).
* *family* can be set to either :data:`socket.AF_INET` or
:data:`~socket.AF_INET6` to force the socket to use IPv4 or IPv6.
* *family* can be set to either :const:`socket.AF_INET` or
:const:`~socket.AF_INET6` to force the socket to use IPv4 or IPv6.
If not set, the *family* will be determined from host name
(defaults to :data:`~socket.AF_UNSPEC`).
(defaults to :const:`~socket.AF_UNSPEC`).
* *flags* is a bitmask for :meth:`getaddrinfo`.
@ -756,7 +756,7 @@ Creating network servers
.. versionchanged:: 3.6
Added *ssl_handshake_timeout* and *start_serving* parameters.
The socket option :py:data:`~socket.TCP_NODELAY` is set by default
The socket option :py:const:`~socket.TCP_NODELAY` is set by default
for all TCP connections.
.. versionchanged:: 3.11
@ -777,7 +777,7 @@ Creating network servers
start_serving=True)
Similar to :meth:`loop.create_server` but works with the
:py:data:`~socket.AF_UNIX` socket family.
:py:const:`~socket.AF_UNIX` socket family.
*path* is the name of a Unix domain socket, and is required,
unless a *sock* argument is provided. Abstract Unix sockets,

View file

@ -37,7 +37,7 @@ All event loops on Windows do not support the following methods:
* :meth:`loop.create_unix_connection` and
:meth:`loop.create_unix_server` are not supported.
The :data:`socket.AF_UNIX` socket family is specific to Unix.
The :const:`socket.AF_UNIX` socket family is specific to Unix.
* :meth:`loop.add_signal_handler` and
:meth:`loop.remove_signal_handler` are not supported.

View file

@ -249,7 +249,7 @@ their completion.
Stop the child process.
On POSIX systems this method sends :py:data:`signal.SIGTERM` to the
On POSIX systems this method sends :py:const:`signal.SIGTERM` to the
child process.
On Windows the Win32 API function :c:func:`TerminateProcess` is

View file

@ -659,8 +659,8 @@ depending on the system error code.
Raised when an operation would block on an object (e.g. socket) set
for non-blocking operation.
Corresponds to :c:data:`errno` :py:data:`~errno.EAGAIN`, :py:data:`~errno.EALREADY`,
:py:data:`~errno.EWOULDBLOCK` and :py:data:`~errno.EINPROGRESS`.
Corresponds to :c:data:`errno` :py:const:`~errno.EAGAIN`, :py:const:`~errno.EALREADY`,
:py:const:`~errno.EWOULDBLOCK` and :py:const:`~errno.EINPROGRESS`.
In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have
one more attribute:
@ -674,7 +674,7 @@ depending on the system error code.
.. exception:: ChildProcessError
Raised when an operation on a child process failed.
Corresponds to :c:data:`errno` :py:data:`~errno.ECHILD`.
Corresponds to :c:data:`errno` :py:const:`~errno.ECHILD`.
.. exception:: ConnectionError
@ -688,40 +688,40 @@ depending on the system error code.
A subclass of :exc:`ConnectionError`, raised when trying to write on a
pipe while the other end has been closed, or trying to write on a socket
which has been shutdown for writing.
Corresponds to :c:data:`errno` :py:data:`~errno.EPIPE` and :py:data:`~errno.ESHUTDOWN`.
Corresponds to :c:data:`errno` :py:const:`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`.
.. exception:: ConnectionAbortedError
A subclass of :exc:`ConnectionError`, raised when a connection attempt
is aborted by the peer.
Corresponds to :c:data:`errno` :py:data:`~errno.ECONNABORTED`.
Corresponds to :c:data:`errno` :py:const:`~errno.ECONNABORTED`.
.. exception:: ConnectionRefusedError
A subclass of :exc:`ConnectionError`, raised when a connection attempt
is refused by the peer.
Corresponds to :c:data:`errno` :py:data:`~errno.ECONNREFUSED`.
Corresponds to :c:data:`errno` :py:const:`~errno.ECONNREFUSED`.
.. exception:: ConnectionResetError
A subclass of :exc:`ConnectionError`, raised when a connection is
reset by the peer.
Corresponds to :c:data:`errno` :py:data:`~errno.ECONNRESET`.
Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`.
.. exception:: FileExistsError
Raised when trying to create a file or directory which already exists.
Corresponds to :c:data:`errno` :py:data:`~errno.EEXIST`.
Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`.
.. exception:: FileNotFoundError
Raised when a file or directory is requested but doesn't exist.
Corresponds to :c:data:`errno` :py:data:`~errno.ENOENT`.
Corresponds to :c:data:`errno` :py:const:`~errno.ENOENT`.
.. exception:: InterruptedError
Raised when a system call is interrupted by an incoming signal.
Corresponds to :c:data:`errno` :py:data:`~errno.EINTR`.
Corresponds to :c:data:`errno` :py:const:`~errno.EINTR`.
.. versionchanged:: 3.5
Python now retries system calls when a syscall is interrupted by a
@ -732,7 +732,7 @@ depending on the system error code.
Raised when a file operation (such as :func:`os.remove`) is requested
on a directory.
Corresponds to :c:data:`errno` :py:data:`~errno.EISDIR`.
Corresponds to :c:data:`errno` :py:const:`~errno.EISDIR`.
.. exception:: NotADirectoryError
@ -740,28 +740,28 @@ depending on the system error code.
something which is not a directory. On most POSIX platforms, it may also be
raised if an operation attempts to open or traverse a non-directory file as if
it were a directory.
Corresponds to :c:data:`errno` :py:data:`~errno.ENOTDIR`.
Corresponds to :c:data:`errno` :py:const:`~errno.ENOTDIR`.
.. exception:: PermissionError
Raised when trying to run an operation without the adequate access
rights - for example filesystem permissions.
Corresponds to :c:data:`errno` :py:data:`~errno.EACCES`,
:py:data:`~errno.EPERM`, and :py:data:`~errno.ENOTCAPABLE`.
Corresponds to :c:data:`errno` :py:const:`~errno.EACCES`,
:py:const:`~errno.EPERM`, and :py:const:`~errno.ENOTCAPABLE`.
.. versionchanged:: 3.11.1
WASI's :py:data:`~errno.ENOTCAPABLE` is now mapped to
WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to
:exc:`PermissionError`.
.. exception:: ProcessLookupError
Raised when a given process doesn't exist.
Corresponds to :c:data:`errno` :py:data:`~errno.ESRCH`.
Corresponds to :c:data:`errno` :py:const:`~errno.ESRCH`.
.. exception:: TimeoutError
Raised when a system function timed out at the system level.
Corresponds to :c:data:`errno` :py:data:`~errno.ETIMEDOUT`.
Corresponds to :c:data:`errno` :py:const:`~errno.ETIMEDOUT`.
.. versionadded:: 3.3
All the above :exc:`OSError` subclasses were added.

View file

@ -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 (:data:`os.SEEK_SET`)
* :const:`1` -- relative to the current buffer position (:data:`os.SEEK_CUR`)
* :const:`2` -- relative to the end of the file (:data:`os.SEEK_END`)
* :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`)
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
@ -201,7 +201,7 @@ using the :func:`flock` call may be better.
.. seealso::
Module :mod:`os`
If the locking flags :data:`~os.O_SHLOCK` and :data:`~os.O_EXLOCK` are
If the locking flags :const:`~os.O_SHLOCK` and :const:`~os.O_EXLOCK` are
present in the :mod:`os` module (on BSD only), the :func:`os.open`
function provides an alternative to the :func:`lockf` and :func:`flock`
functions.

View file

@ -105,7 +105,7 @@ The module defines the following items:
.. versionchanged:: 3.4
The class now supports hostname check with
:attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
:data:`ssl.HAS_SNI`).
:const:`ssl.HAS_SNI`).
.. versionchanged:: 3.9
If the *timeout* parameter is set to be zero, it will raise a
@ -441,7 +441,7 @@ FTP_TLS Objects
.. versionchanged:: 3.4
The method now supports hostname check with
:attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
:data:`ssl.HAS_SNI`).
:const:`ssl.HAS_SNI`).
.. method:: FTP_TLS.ccc()

View file

@ -83,7 +83,7 @@ The module provides the following classes:
.. versionchanged:: 3.2
This class now supports HTTPS virtual hosts if possible (that is,
if :data:`ssl.HAS_SNI` is true).
if :const:`ssl.HAS_SNI` is true).
.. versionchanged:: 3.4
The *strict* parameter was removed. HTTP 0.9-style "Simple Responses" are

View file

@ -106,7 +106,7 @@ There's also a subclass for secure connections:
.. versionchanged:: 3.4
The class now supports hostname check with
:attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
:data:`ssl.HAS_SNI`).
:const:`ssl.HAS_SNI`).
.. versionchanged:: 3.9
The optional *timeout* parameter was added.
@ -503,7 +503,7 @@ An :class:`IMAP4` instance has the following methods:
.. versionchanged:: 3.4
The method now supports hostname check with
:attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
:data:`ssl.HAS_SNI`).
:const:`ssl.HAS_SNI`).
.. method:: IMAP4.status(mailbox, names)

View file

@ -423,7 +423,7 @@ I/O Base Classes
.. versionadded:: 3.3
Some operating systems could support additional values, like
:data:`os.SEEK_HOLE` or :data:`os.SEEK_DATA`. The valid values
:const:`os.SEEK_HOLE` or :const:`os.SEEK_DATA`. The valid values
for a file could depend on it being open in text or binary mode.
.. method:: seekable()

View file

@ -2707,7 +2707,7 @@ handler type) for messages from different processes to get mixed up.
Returns the logger used by :mod:`multiprocessing`. If necessary, a new one
will be created.
When first created the logger has level :data:`logging.NOTSET` and no
When first created the logger has level :const:`logging.NOTSET` and no
default handler. Messages sent to this logger will not by default propagate
to the root logger.

View file

@ -813,7 +813,7 @@ The first step in using :mod:`optparse` is to create an OptionParser instance.
help option. When :mod:`optparse` prints the usage string, it expands
``%prog`` to ``os.path.basename(sys.argv[0])`` (or to ``prog`` if you
passed that keyword argument). To suppress a usage message, pass the
special value :data:`optparse.SUPPRESS_USAGE`.
special value :const:`optparse.SUPPRESS_USAGE`.
``option_list`` (default: ``[]``)
A list of Option objects to populate the parser with. The options in
@ -1079,7 +1079,7 @@ relevant to a particular option, or fail to pass a required option attribute,
Help text to print for this option when listing all available options after
the user supplies a :attr:`~Option.help` option (such as ``--help``). If
no help text is supplied, the option will be listed without help text. To
hide this option, use the special value :data:`optparse.SUPPRESS_HELP`.
hide this option, use the special value :const:`optparse.SUPPRESS_HELP`.
.. attribute:: Option.metavar
@ -1251,7 +1251,7 @@ must specify for any option using that action.
If no :attr:`~Option.help` string is supplied for an option, it will still be
listed in the help message. To omit an option entirely, use the special value
:data:`optparse.SUPPRESS_HELP`.
:const:`optparse.SUPPRESS_HELP`.
:mod:`optparse` automatically adds a :attr:`~Option.help` option to all
OptionParsers, so you do not normally need to create one.
@ -1522,7 +1522,7 @@ OptionParser supports several other public methods:
Set the usage string according to the rules described above for the ``usage``
constructor keyword argument. Passing ``None`` sets the default usage
string; use :data:`optparse.SUPPRESS_USAGE` to suppress a usage message.
string; use :const:`optparse.SUPPRESS_USAGE` to suppress a usage message.
.. method:: OptionParser.print_usage(file=None)

View file

@ -233,7 +233,7 @@ process and user.
:data:`environ` and :data:`environb` are synchronized (modifying
:data:`environb` updates :data:`environ`, and vice versa).
:data:`environb` is only available if :data:`supports_bytes_environ` is
:data:`environb` is only available if :const:`supports_bytes_environ` is
``True``.
.. versionadded:: 3.2
@ -331,7 +331,7 @@ process and user.
future environment changes.
:func:`getenvb` is only available if :data:`supports_bytes_environ`
:func:`getenvb` is only available if :const:`supports_bytes_environ`
is ``True``.
.. availability:: Unix.
@ -923,7 +923,7 @@ as internal buffering of data.
In Linux kernel older than 5.3, the files pointed by *src* and *dst*
must reside in the same filesystem, otherwise an :exc:`OSError` is
raised with :attr:`~OSError.errno` set to :data:`errno.EXDEV`.
raised with :attr:`~OSError.errno` set to :const:`errno.EXDEV`.
This copy is done without the additional cost of transferring data
from the kernel to user space and then back into the kernel. Additionally,
@ -1181,7 +1181,7 @@ as internal buffering of data.
.. versionadded:: 3.3
Some operating systems could support additional values, like
:data:`os.SEEK_HOLE` or :data:`os.SEEK_DATA`.
:const:`os.SEEK_HOLE` or :const:`os.SEEK_DATA`.
.. function:: open(path, flags, mode=0o777, *, dir_fd=None)
@ -1422,7 +1422,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
If some data was successfully read, it will return the number of bytes read.
If no bytes were read, it will return ``-1`` and set errno to
:data:`errno.EAGAIN`.
:const:`errno.EAGAIN`.
.. availability:: Linux >= 4.14.
@ -1627,7 +1627,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
*offset_dst*. The offset associated to the file descriptor that refers to a
pipe must be ``None``. The files pointed by *src* and *dst* must reside in
the same filesystem, otherwise an :exc:`OSError` is raised with
:attr:`~OSError.errno` set to :data:`errno.EXDEV`.
:attr:`~OSError.errno` set to :const:`errno.EXDEV`.
This copy is done without the additional cost of transferring data
from the kernel to user space and then back into the kernel. Additionally,
@ -1960,18 +1960,18 @@ features:
Set the flags of *path* to the numeric *flags*. *flags* may take a combination
(bitwise OR) of the following values (as defined in the :mod:`stat` module):
* :data:`stat.UF_NODUMP`
* :data:`stat.UF_IMMUTABLE`
* :data:`stat.UF_APPEND`
* :data:`stat.UF_OPAQUE`
* :data:`stat.UF_NOUNLINK`
* :data:`stat.UF_COMPRESSED`
* :data:`stat.UF_HIDDEN`
* :data:`stat.SF_ARCHIVED`
* :data:`stat.SF_IMMUTABLE`
* :data:`stat.SF_APPEND`
* :data:`stat.SF_NOUNLINK`
* :data:`stat.SF_SNAPSHOT`
* :const:`stat.UF_NODUMP`
* :const:`stat.UF_IMMUTABLE`
* :const:`stat.UF_APPEND`
* :const:`stat.UF_OPAQUE`
* :const:`stat.UF_NOUNLINK`
* :const:`stat.UF_COMPRESSED`
* :const:`stat.UF_HIDDEN`
* :const:`stat.SF_ARCHIVED`
* :const:`stat.SF_IMMUTABLE`
* :const:`stat.SF_APPEND`
* :const:`stat.SF_NOUNLINK`
* :const:`stat.SF_SNAPSHOT`
This function can support :ref:`not following symlinks <follow_symlinks>`.
@ -1992,25 +1992,25 @@ features:
following values (as defined in the :mod:`stat` module) or bitwise ORed
combinations of them:
* :data:`stat.S_ISUID`
* :data:`stat.S_ISGID`
* :data:`stat.S_ENFMT`
* :data:`stat.S_ISVTX`
* :data:`stat.S_IREAD`
* :data:`stat.S_IWRITE`
* :data:`stat.S_IEXEC`
* :data:`stat.S_IRWXU`
* :data:`stat.S_IRUSR`
* :data:`stat.S_IWUSR`
* :data:`stat.S_IXUSR`
* :data:`stat.S_IRWXG`
* :data:`stat.S_IRGRP`
* :data:`stat.S_IWGRP`
* :data:`stat.S_IXGRP`
* :data:`stat.S_IRWXO`
* :data:`stat.S_IROTH`
* :data:`stat.S_IWOTH`
* :data:`stat.S_IXOTH`
* :const:`stat.S_ISUID`
* :const:`stat.S_ISGID`
* :const:`stat.S_ENFMT`
* :const:`stat.S_ISVTX`
* :const:`stat.S_IREAD`
* :const:`stat.S_IWRITE`
* :const:`stat.S_IEXEC`
* :const:`stat.S_IRWXU`
* :const:`stat.S_IRUSR`
* :const:`stat.S_IWUSR`
* :const:`stat.S_IXUSR`
* :const:`stat.S_IRWXG`
* :const:`stat.S_IRGRP`
* :const:`stat.S_IWGRP`
* :const:`stat.S_IXGRP`
* :const:`stat.S_IRWXO`
* :const:`stat.S_IROTH`
* :const:`stat.S_IWOTH`
* :const:`stat.S_IXOTH`
This function can support :ref:`specifying a file descriptor <path_fd>`,
:ref:`paths relative to directory descriptors <dir_fd>` and :ref:`not
@ -4151,8 +4151,8 @@ written in Python, such as a mail server's external command delivery program.
Send signal *sig* to the process *pid*. Constants for the specific signals
available on the host platform are defined in the :mod:`signal` module.
Windows: The :data:`signal.CTRL_C_EVENT` and
:data:`signal.CTRL_BREAK_EVENT` signals are special signals which can
Windows: The :const:`signal.CTRL_C_EVENT` and
:const:`signal.CTRL_BREAK_EVENT` signals are special signals which can
only be sent to console processes which share a common console window,
e.g., some subprocesses. Any other value for *sig* will cause the process
to be unconditionally killed by the TerminateProcess API, and the exit code
@ -4205,7 +4205,7 @@ written in Python, such as a mail server's external command delivery program.
This flag indicates that the file descriptor will be non-blocking.
If the process referred to by the file descriptor has not yet terminated,
then an attempt to wait on the file descriptor using :manpage:`waitid(2)`
will immediately return the error :data:`~errno.EAGAIN` rather than blocking.
will immediately return the error :const:`~errno.EAGAIN` rather than blocking.
.. availability:: Linux >= 5.10
.. versionadded:: 3.12
@ -4654,7 +4654,7 @@ written in Python, such as a mail server's external command delivery program.
* :attr:`!si_pid` (process ID)
* :attr:`!si_uid` (real user ID of the child)
* :attr:`!si_signo` (always :data:`~signal.SIGCHLD`)
* :attr:`!si_signo` (always :const:`~signal.SIGCHLD`)
* :attr:`!si_status` (the exit status or signal number, depending on :attr:`!si_code`)
* :attr:`!si_code` (see :data:`CLD_EXITED` for possible values)
@ -4892,7 +4892,7 @@ used to determine the disposition of a process.
.. function:: WIFCONTINUED(status)
Return ``True`` if a stopped child has been resumed by delivery of
:data:`~signal.SIGCONT` (if the process has been continued from a job
:const:`~signal.SIGCONT` (if the process has been continued from a job
control stop), otherwise return ``False``.
See :data:`WCONTINUED` option.
@ -5264,7 +5264,7 @@ Random numbers
``/dev/urandom`` devices.
The flags argument is a bit mask that can contain zero or more of the
following values ORed together: :py:data:`os.GRND_RANDOM` and
following values ORed together: :py:const:`os.GRND_RANDOM` and
:py:data:`GRND_NONBLOCK`.
See also the `Linux getrandom() manual page

View file

@ -77,7 +77,7 @@ The :mod:`poplib` module provides two classes:
.. versionchanged:: 3.4
The class now supports hostname check with
:attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
:data:`ssl.HAS_SNI`).
:const:`ssl.HAS_SNI`).
.. versionchanged:: 3.9
If the *timeout* parameter is set to be zero, it will raise a
@ -240,7 +240,7 @@ A :class:`POP3` instance has the following methods:
This method supports hostname checking via
:attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
:data:`ssl.HAS_SNI`).
:const:`ssl.HAS_SNI`).
.. versionadded:: 3.4

View file

@ -25,7 +25,7 @@ lots of shared sub-objects. The keys are ordinary strings.
database file is opened for reading and writing. The optional *flag* parameter
has the same interpretation as the *flag* parameter of :func:`dbm.open`.
By default, pickles created with :data:`pickle.DEFAULT_PROTOCOL` are used
By default, pickles created with :const:`pickle.DEFAULT_PROTOCOL` are used
to serialize values. The version of the pickle protocol can be specified
with the *protocol* parameter.
@ -42,7 +42,7 @@ lots of shared sub-objects. The keys are ordinary strings.
mutated).
.. versionchanged:: 3.10
:data:`pickle.DEFAULT_PROTOCOL` is now used as the default pickle
:const:`pickle.DEFAULT_PROTOCOL` is now used as the default pickle
protocol.
.. versionchanged:: 3.11
@ -119,7 +119,7 @@ Restrictions
A subclass of :class:`collections.abc.MutableMapping` which stores pickled
values in the *dict* object.
By default, pickles created with :data:`pickle.DEFAULT_PROTOCOL` are used
By default, pickles created with :const:`pickle.DEFAULT_PROTOCOL` are used
to serialize values. The version of the pickle protocol can be specified
with the *protocol* parameter. See the :mod:`pickle` documentation for a
discussion of the pickle protocols.
@ -143,7 +143,7 @@ Restrictions
Added context manager support.
.. versionchanged:: 3.10
:data:`pickle.DEFAULT_PROTOCOL` is now used as the default pickle
:const:`pickle.DEFAULT_PROTOCOL` is now used as the default pickle
protocol.

View file

@ -98,7 +98,7 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
.. versionchanged:: 3.4
The class now supports hostname check with
:attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
:data:`ssl.HAS_SNI`).
:const:`ssl.HAS_SNI`).
.. versionchanged:: 3.9
If the *timeout* parameter is set to be zero, it will raise a
@ -418,7 +418,7 @@ An :class:`SMTP` instance has the following methods:
.. versionchanged:: 3.4
The method now supports hostname check with
:attr:`SSLContext.check_hostname` and *Server Name Indicator* (see
:data:`~ssl.HAS_SNI`).
:const:`~ssl.HAS_SNI`).
.. versionchanged:: 3.5
The error raised for lack of STARTTLS support is now the

View file

@ -2252,7 +2252,7 @@ This is because the previous execution has left the socket in a ``TIME_WAIT``
state, and can't be immediately reused.
There is a :mod:`socket` flag to set, in order to prevent this,
:data:`socket.SO_REUSEADDR`::
:const:`socket.SO_REUSEADDR`::
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

View file

@ -299,7 +299,7 @@ Module functions
Can be ``"DEFERRED"`` (default), ``"EXCLUSIVE"`` or ``"IMMEDIATE"``;
or ``None`` to disable opening transactions implicitly.
Has no effect unless :attr:`Connection.autocommit` is set to
:data:`~sqlite3.LEGACY_TRANSACTION_CONTROL` (the default).
:const:`~sqlite3.LEGACY_TRANSACTION_CONTROL` (the default).
:type isolation_level: str | None
:param bool check_same_thread:
@ -334,7 +334,7 @@ Module functions
See :attr:`Connection.autocommit` and
:ref:`sqlite3-transaction-control-autocommit` for more information.
*autocommit* currently defaults to
:data:`~sqlite3.LEGACY_TRANSACTION_CONTROL`.
:const:`~sqlite3.LEGACY_TRANSACTION_CONTROL`.
The default will change to ``False`` in a future Python release.
:type autocommit: bool
@ -1818,9 +1818,9 @@ Blob objects
.. method:: seek(offset, origin=os.SEEK_SET, /)
Set the current access position of the blob to *offset*. The *origin*
argument defaults to :data:`os.SEEK_SET` (absolute blob positioning).
Other values for *origin* are :data:`os.SEEK_CUR` (seek relative to the
current position) and :data:`os.SEEK_END` (seek relative to the blobs
argument defaults to :const:`os.SEEK_SET` (absolute blob positioning).
Other values for *origin* are :const:`os.SEEK_CUR` (seek relative to the
current position) and :const:`os.SEEK_END` (seek relative to the blobs
end).

View file

@ -139,7 +139,7 @@ purposes.
The settings are: :data:`PROTOCOL_TLS_CLIENT` or
:data:`PROTOCOL_TLS_SERVER`, :data:`OP_NO_SSLv2`, and :data:`OP_NO_SSLv3`
with high encryption cipher suites without RC4 and
without unauthenticated cipher suites. Passing :data:`~Purpose.SERVER_AUTH`
without unauthenticated cipher suites. Passing :const:`~Purpose.SERVER_AUTH`
as *purpose* sets :data:`~SSLContext.verify_mode` to :data:`CERT_REQUIRED`
and either loads CA certificates (when at least one of *cafile*, *capath* or
*cadata* is given) or uses :meth:`SSLContext.load_default_certs` to load
@ -1484,9 +1484,9 @@ to speed up repeated connections from the same clients.
load CA certificates from other locations, too.
The *purpose* flag specifies what kind of CA certificates are loaded. The
default settings :data:`Purpose.SERVER_AUTH` loads certificates, that are
default settings :const:`Purpose.SERVER_AUTH` loads certificates, that are
flagged and trusted for TLS web server authentication (client side
sockets). :data:`Purpose.CLIENT_AUTH` loads CA certificates for client
sockets). :const:`Purpose.CLIENT_AUTH` loads CA certificates for client
certificate verification on the server side.
.. versionadded:: 3.4
@ -1729,7 +1729,7 @@ to speed up repeated connections from the same clients.
Wrap an existing Python socket *sock* and return an instance of
:attr:`SSLContext.sslsocket_class` (default :class:`SSLSocket`). The
returned SSL socket is tied to the context, its settings and certificates.
*sock* must be a :data:`~socket.SOCK_STREAM` socket; other
*sock* must be a :const:`~socket.SOCK_STREAM` socket; other
socket types are unsupported.
The parameter ``server_side`` is a boolean which identifies whether

View file

@ -697,7 +697,7 @@ always available.
Return the current value of the flags that are used for
:c:func:`dlopen` calls. Symbolic names for the flag values can be
found in the :mod:`os` module (``RTLD_xxx`` constants, e.g.
:data:`os.RTLD_LAZY`).
:const:`os.RTLD_LAZY`).
.. availability:: Unix.
@ -1368,7 +1368,7 @@ always available.
``sys.setdlopenflags(0)``. To share symbols across extension modules, call as
``sys.setdlopenflags(os.RTLD_GLOBAL)``. Symbolic names for the flag values
can be found in the :mod:`os` module (``RTLD_xxx`` constants, e.g.
:data:`os.RTLD_LAZY`).
:const:`os.RTLD_LAZY`).
.. availability:: Unix.

View file

@ -59,7 +59,7 @@ The module defines the following user-callable items:
platforms, it is a file-like object whose :attr:`!file` attribute is the
underlying true file object.
The :py:data:`os.O_TMPFILE` flag is used if it is available and works
The :py:const:`os.O_TMPFILE` flag is used if it is available and works
(Linux-specific, requires Linux kernel 3.11 or later).
On platforms that are neither Posix nor Cygwin, TemporaryFile is an alias
@ -69,7 +69,7 @@ The module defines the following user-callable items:
.. versionchanged:: 3.5
The :py:data:`os.O_TMPFILE` flag is now used if available.
The :py:const:`os.O_TMPFILE` flag is now used if available.
.. versionchanged:: 3.8
Added *errors* parameter.

View file

@ -472,7 +472,7 @@ The :mod:`test.support` module defines the following functions:
.. function:: with_pymalloc()
Return :data:`_testcapi.WITH_PYMALLOC`.
Return :const:`_testcapi.WITH_PYMALLOC`.
.. function:: requires(resource, msg=None)

View file

@ -2485,7 +2485,7 @@ behaviour you can switch it off by setting the module level switch
Alternatively you can just use ``vars(my_mock)`` (instance members) and
``dir(type(my_mock))`` (type members) to bypass the filtering irrespective of
:data:`mock.FILTER_DIR`.
:const:`mock.FILTER_DIR`.
mock_open

View file

@ -91,7 +91,7 @@ The :mod:`urllib.request` module defines the following functions:
.. versionchanged:: 3.2
HTTPS virtual hosts are now supported if possible (that is, if
:data:`ssl.HAS_SNI` is true).
:const:`ssl.HAS_SNI` is true).
.. versionadded:: 3.2
*data* can be an iterable object.

View file

@ -73,7 +73,7 @@ decompression bomb Safe Safe Safe
1. Expat 2.4.1 and newer is not vulnerable to the "billion laughs" and
"quadratic blowup" vulnerabilities. Items still listed as vulnerable due to
potential reliance on system-provided libraries. Check
:data:`pyexpat.EXPAT_VERSION`.
:const:`pyexpat.EXPAT_VERSION`.
2. :mod:`xml.etree.ElementTree` doesn't expand external entities and raises a
:exc:`ParserError` when an entity occurs.
3. :mod:`xml.dom.minidom` doesn't expand external entities and simply returns