Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into pythongh-86179
Browse files Browse the repository at this point in the history
  • Loading branch information
zooba committed Dec 13, 2023
2 parents d37c113 + 79dad03 commit 01bd133
Show file tree
Hide file tree
Showing 86 changed files with 920 additions and 315 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/reusable-windows.yml
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build CPython
run: .\PCbuild\build.bat -e -d -p Win32 ${{ inputs.free-threaded && '--disable-gil' || '' }}
run: .\PCbuild\build.bat -e -d -v -p Win32 ${{ inputs.free-threaded && '--disable-gil' || '' }}
- name: Display build info
run: .\python.bat -m test.pythoninfo
- name: Tests
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Register MSVC problem matcher
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Build CPython
run: .\PCbuild\build.bat -e -d -p x64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
run: .\PCbuild\build.bat -e -d -v -p x64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
- name: Display build info
run: .\python.bat -m test.pythoninfo
- name: Tests
Expand All @@ -50,4 +50,4 @@ jobs:
- name: Register MSVC problem matcher
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Build CPython
run: .\PCbuild\build.bat -e -d -p arm64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
run: .\PCbuild\build.bat -e -d -v -p arm64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
8 changes: 8 additions & 0 deletions Doc/library/asyncio-eventloop.rst
Expand Up @@ -671,6 +671,7 @@ Creating network servers
flags=socket.AI_PASSIVE, \
sock=None, backlog=100, ssl=None, \
reuse_address=None, reuse_port=None, \
keep_alive=None, \
ssl_handshake_timeout=None, \
ssl_shutdown_timeout=None, \
start_serving=True)
Expand Down Expand Up @@ -735,6 +736,13 @@ Creating network servers
set this flag when being created. This option is not supported on
Windows.

* *keep_alive* set to ``True`` keeps connections active by enabling the
periodic transmission of messages.

.. versionchanged:: 3.13

Added the *keep_alive* parameter.

* *ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait
for the TLS handshake to complete before aborting the connection.
``60.0`` seconds if ``None`` (default).
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/bdb.rst
Expand Up @@ -294,7 +294,7 @@ The :mod:`bdb` module also defines two classes:
.. method:: set_quit()

Set the :attr:`quitting` attribute to ``True``. This raises :exc:`BdbQuit` in
the next call to one of the :meth:`dispatch_\*` methods.
the next call to one of the :meth:`!dispatch_\*` methods.


Derived classes and clients can call the following methods to manipulate
Expand Down
14 changes: 7 additions & 7 deletions Doc/library/cmd.rst
Expand Up @@ -83,7 +83,7 @@ A :class:`Cmd` instance has the following methods:

This method will return when the :meth:`postcmd` method returns a true value.
The *stop* argument to :meth:`postcmd` is the return value from the command's
corresponding :meth:`do_\*` method.
corresponding :meth:`!do_\*` method.

If completion is enabled, completing commands will be done automatically, and
completing of commands args is done by calling :meth:`complete_foo` with
Expand All @@ -98,7 +98,7 @@ A :class:`Cmd` instance has the following methods:
:meth:`help_bar`, and if that is not present, prints the docstring of
:meth:`do_bar`, if available. With no argument, :meth:`do_help` lists all
available help topics (that is, all commands with corresponding
:meth:`help_\*` methods or commands that have docstrings), and also lists any
:meth:`!help_\*` methods or commands that have docstrings), and also lists any
undocumented commands.


Expand All @@ -108,7 +108,7 @@ A :class:`Cmd` instance has the following methods:
This may be overridden, but should not normally need to be; see the
:meth:`precmd` and :meth:`postcmd` methods for useful execution hooks. The
return value is a flag indicating whether interpretation of commands by the
interpreter should stop. If there is a :meth:`do_\*` method for the command
interpreter should stop. If there is a :meth:`!do_\*` method for the command
*str*, the return value of that method is returned, otherwise the return value
from the :meth:`default` method is returned.

Expand All @@ -128,7 +128,7 @@ A :class:`Cmd` instance has the following methods:
.. method:: Cmd.completedefault(text, line, begidx, endidx)

Method called to complete an input line when no command-specific
:meth:`complete_\*` method is available. By default, it returns an empty list.
:meth:`!complete_\*` method is available. By default, it returns an empty list.


.. method:: Cmd.columnize(list, displaywidth=80)
Expand Down Expand Up @@ -209,14 +209,14 @@ Instances of :class:`Cmd` subclasses have some public instance variables:
.. attribute:: Cmd.misc_header

The header to issue if the help output has a section for miscellaneous help
topics (that is, there are :meth:`help_\*` methods without corresponding
:meth:`do_\*` methods).
topics (that is, there are :meth:`!help_\*` methods without corresponding
:meth:`!do_\*` methods).


.. attribute:: Cmd.undoc_header

The header to issue if the help output has a section for undocumented commands
(that is, there are :meth:`do_\*` methods without corresponding :meth:`help_\*`
(that is, there are :meth:`!do_\*` methods without corresponding :meth:`!help_\*`
methods).


Expand Down
2 changes: 1 addition & 1 deletion Doc/library/configparser.rst
Expand Up @@ -955,7 +955,7 @@ ConfigParser Objects
When *converters* is given, it should be a dictionary where each key
represents the name of a type converter and each value is a callable
implementing the conversion from string to the desired datatype. Every
converter gets its own corresponding :meth:`get*()` method on the parser
converter gets its own corresponding :meth:`!get*()` method on the parser
object and section proxies.

.. versionchanged:: 3.1
Expand Down
6 changes: 4 additions & 2 deletions Doc/library/csv.rst
Expand Up @@ -309,6 +309,8 @@ An example for :class:`Sniffer` use::
# ... process CSV file contents here ...


.. _csv-constants:

The :mod:`csv` module defines the following constants:

.. data:: QUOTE_ALL
Expand Down Expand Up @@ -432,8 +434,8 @@ Dialects support the following attributes:
.. attribute:: Dialect.quoting

Controls when quotes should be generated by the writer and recognised by the
reader. It can take on any of the :const:`QUOTE_\*` constants (see section
:ref:`csv-contents`) and defaults to :const:`QUOTE_MINIMAL`.
reader. It can take on any of the :ref:`QUOTE_\* constants <csv-constants>`
and defaults to :const:`QUOTE_MINIMAL`.


.. attribute:: Dialect.skipinitialspace
Expand Down
18 changes: 15 additions & 3 deletions Doc/library/dis.rst
Expand Up @@ -328,13 +328,17 @@ operation is being performed, so the intermediate analysis object isn't useful:
source line information (if any) is taken directly from the disassembled code
object.

The *show_caches* and *adaptive* parameters work as they do in :func:`dis`.
The *adaptive* parameter works as it does in :func:`dis`.

.. versionadded:: 3.4

.. versionchanged:: 3.11
Added the *show_caches* and *adaptive* parameters.

.. versionchanged:: 3.13
The *show_caches* parameter is deprecated and has no effect. The *cache_info*
field of each instruction is populated regardless of its value.


.. function:: findlinestarts(code)

Expand Down Expand Up @@ -482,6 +486,14 @@ details of bytecode instructions as :class:`Instruction` instances:
:class:`dis.Positions` object holding the
start and end locations that are covered by this instruction.

.. data::cache_info
Information about the cache entries of this instruction, as
triplets of the form ``(name, size, data)``, where the ``name``
and ``size`` describe the cache format and data is the contents
of the cache. ``cache_info`` is ``None`` if the instruction does not have
caches.
.. versionadded:: 3.4

.. versionchanged:: 3.11
Expand All @@ -493,8 +505,8 @@ details of bytecode instructions as :class:`Instruction` instances:
Changed field ``starts_line``.

Added fields ``start_offset``, ``cache_offset``, ``end_offset``,
``baseopname``, ``baseopcode``, ``jump_target``, ``oparg``, and
``line_number``.
``baseopname``, ``baseopcode``, ``jump_target``, ``oparg``,
``line_number`` and ``cache_info``.


.. class:: Positions
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/http.server.rst
Expand Up @@ -65,10 +65,10 @@ provides three different variants:

The handler will parse the request and the headers, then call a method
specific to the request type. The method name is constructed from the
request. For example, for the request method ``SPAM``, the :meth:`do_SPAM`
request. For example, for the request method ``SPAM``, the :meth:`!do_SPAM`
method will be called with no arguments. All of the relevant information is
stored in instance variables of the handler. Subclasses should not need to
override or extend the :meth:`__init__` method.
override or extend the :meth:`!__init__` method.

:class:`BaseHTTPRequestHandler` has the following instance variables:

Expand Down Expand Up @@ -187,13 +187,13 @@ provides three different variants:

Calls :meth:`handle_one_request` once (or, if persistent connections are
enabled, multiple times) to handle incoming HTTP requests. You should
never need to override it; instead, implement appropriate :meth:`do_\*`
never need to override it; instead, implement appropriate :meth:`!do_\*`
methods.

.. method:: handle_one_request()

This method will parse and dispatch the request to the appropriate
:meth:`do_\*` method. You should never need to override it.
:meth:`!do_\*` method. You should never need to override it.

.. method:: handle_expect_100()

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/locale.rst
Expand Up @@ -309,7 +309,7 @@ The :mod:`locale` module defines the following exception and functions:
.. function:: getlocale(category=LC_CTYPE)

Returns the current setting for the given locale category as sequence containing
*language code*, *encoding*. *category* may be one of the :const:`LC_\*` values
*language code*, *encoding*. *category* may be one of the :const:`!LC_\*` values
except :const:`LC_ALL`. It defaults to :const:`LC_CTYPE`.

Except for the code ``'C'``, the language code corresponds to :rfc:`1766`.
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/os.rst
Expand Up @@ -4170,7 +4170,7 @@ to be ignored.
The "l" and "v" variants of the :func:`exec\* <execl>` functions differ in how
command-line arguments are passed. The "l" variants are perhaps the easiest
to work with if the number of parameters is fixed when the code is written; the
individual parameters simply become additional parameters to the :func:`execl\*`
individual parameters simply become additional parameters to the :func:`!execl\*`
functions. The "v" variants are good when the number of parameters is
variable, with the arguments being passed in a list or tuple as the *args*
parameter. In either case, the arguments to the child process should start with
Expand Down Expand Up @@ -4708,7 +4708,7 @@ written in Python, such as a mail server's external command delivery program.
command-line arguments are passed. The "l" variants are perhaps the easiest
to work with if the number of parameters is fixed when the code is written; the
individual parameters simply become additional parameters to the
:func:`spawnl\*` functions. The "v" variants are good when the number of
:func:`!spawnl\*` functions. The "v" variants are good when the number of
parameters is variable, with the arguments being passed in a list or tuple as
the *args* parameter. In either case, the arguments to the child process must
start with the name of the command being run.
Expand Down Expand Up @@ -4758,7 +4758,7 @@ written in Python, such as a mail server's external command delivery program.
P_NOWAITO

Possible values for the *mode* parameter to the :func:`spawn\* <spawnl>` family of
functions. If either of these values is given, the :func:`spawn\*` functions
functions. If either of these values is given, the :func:`spawn\* <spawnl>` functions
will return as soon as the new process has been created, with the process id as
the return value.

Expand All @@ -4768,7 +4768,7 @@ written in Python, such as a mail server's external command delivery program.
.. data:: P_WAIT

Possible value for the *mode* parameter to the :func:`spawn\* <spawnl>` family of
functions. If this is given as *mode*, the :func:`spawn\*` functions will not
functions. If this is given as *mode*, the :func:`spawn\* <spawnl>` functions will not
return until the new process has run to completion and will return the exit code
of the process the run is successful, or ``-signal`` if a signal kills the
process.
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/resource.rst
Expand Up @@ -277,7 +277,7 @@ These functions are used to retrieve resource usage information:

This function returns an object that describes the resources consumed by either
the current process or its children, as specified by the *who* parameter. The
*who* parameter should be specified using one of the :const:`RUSAGE_\*`
*who* parameter should be specified using one of the :const:`!RUSAGE_\*`
constants described below.

A simple example::
Expand Down Expand Up @@ -353,7 +353,7 @@ These functions are used to retrieve resource usage information:
Returns the number of bytes in a system page. (This need not be the same as the
hardware page size.)

The following :const:`RUSAGE_\*` symbols are passed to the :func:`getrusage`
The following :const:`!RUSAGE_\*` symbols are passed to the :func:`getrusage`
function to specify which processes information should be provided for.


Expand Down
8 changes: 4 additions & 4 deletions Doc/library/socket.rst
Expand Up @@ -311,7 +311,7 @@ Exceptions
The accompanying value is a pair ``(error, string)`` representing an error
returned by a library call. *string* represents the description of
*error*, as returned by the :c:func:`gai_strerror` C function. The
numeric *error* value will match one of the :const:`EAI_\*` constants
numeric *error* value will match one of the :const:`!EAI_\*` constants
defined in this module.

.. versionchanged:: 3.3
Expand Down Expand Up @@ -1517,7 +1517,7 @@ to sockets.
.. method:: socket.getsockopt(level, optname[, buflen])

Return the value of the given socket option (see the Unix man page
:manpage:`getsockopt(2)`). The needed symbolic constants (:const:`SO_\*` etc.)
:manpage:`getsockopt(2)`). The needed symbolic constants (:ref:`SO_\* etc. <socket-unix-constants>`)
are defined in this module. If *buflen* is absent, an integer option is assumed
and its integer value is returned by the function. If *buflen* is present, it
specifies the maximum length of the buffer used to receive the option in, and
Expand Down Expand Up @@ -1937,8 +1937,8 @@ to sockets.
.. index:: pair: module; struct

Set the value of the given socket option (see the Unix manual page
:manpage:`setsockopt(2)`). The needed symbolic constants are defined in the
:mod:`socket` module (:const:`SO_\*` etc.). The value can be an integer,
:manpage:`setsockopt(2)`). The needed symbolic constants are defined in this
module (:ref:`!SO_\* etc. <socket-unix-constants>`). The value can be an integer,
``None`` or a :term:`bytes-like object` representing a buffer. In the later
case it is up to the caller to ensure that the bytestring contains the
proper bits (see the optional built-in module :mod:`struct` for a way to
Expand Down
14 changes: 7 additions & 7 deletions Doc/library/unittest.rst
Expand Up @@ -390,8 +390,8 @@ testing code::
widget = Widget('The widget')
self.assertEqual(widget.size(), (50, 50))

Note that in order to test something, we use one of the :meth:`assert\*`
methods provided by the :class:`TestCase` base class. If the test fails, an
Note that in order to test something, we use one of the :ref:`assert\* methods <assert-methods>`
provided by the :class:`TestCase` base class. If the test fails, an
exception will be raised with an explanatory message, and :mod:`unittest`
will identify the test case as a :dfn:`failure`. Any other exceptions will be
treated as :dfn:`errors`.
Expand Down Expand Up @@ -1940,14 +1940,14 @@ Loading and running tests
String giving the prefix of method names which will be interpreted as test
methods. The default value is ``'test'``.

This affects :meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*`
This affects :meth:`getTestCaseNames` and all the ``loadTestsFrom*``
methods.


.. attribute:: sortTestMethodsUsing

Function to be used to compare method names when sorting them in
:meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*` methods.
:meth:`getTestCaseNames` and all the ``loadTestsFrom*`` methods.


.. attribute:: suiteClass
Expand All @@ -1956,7 +1956,7 @@ Loading and running tests
methods on the resulting object are needed. The default value is the
:class:`TestSuite` class.

This affects all the :meth:`loadTestsFrom\*` methods.
This affects all the ``loadTestsFrom*`` methods.

.. attribute:: testNamePatterns

Expand All @@ -1969,7 +1969,7 @@ Loading and running tests
so unlike patterns passed to the ``-k`` option, simple substring patterns
will have to be converted using ``*`` wildcards.

This affects all the :meth:`loadTestsFrom\*` methods.
This affects all the ``loadTestsFrom*`` methods.

.. versionadded:: 3.7

Expand Down Expand Up @@ -2003,7 +2003,7 @@ Loading and running tests

A list containing 2-tuples of :class:`TestCase` instances and strings
holding formatted tracebacks. Each tuple represents a test where a failure
was explicitly signalled using the :meth:`TestCase.assert\*` methods.
was explicitly signalled using the :ref:`assert\* methods <assert-methods>`.

.. attribute:: skipped

Expand Down
8 changes: 4 additions & 4 deletions Doc/library/urllib.request.rst
Expand Up @@ -712,8 +712,8 @@ The following attribute and methods should only be used by classes derived from
.. note::

The convention has been adopted that subclasses defining
:meth:`<protocol>_request` or :meth:`<protocol>_response` methods are named
:class:`\*Processor`; all others are named :class:`\*Handler`.
:meth:`!<protocol>_request` or :meth:`!<protocol>_response` methods are named
:class:`!\*Processor`; all others are named :class:`!\*Handler`.


.. attribute:: BaseHandler.parent
Expand Down Expand Up @@ -833,9 +833,9 @@ HTTPRedirectHandler Objects
.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl)

Return a :class:`Request` or ``None`` in response to a redirect. This is called
by the default implementations of the :meth:`http_error_30\*` methods when a
by the default implementations of the :meth:`!http_error_30\*` methods when a
redirection is received from the server. If a redirection should take place,
return a new :class:`Request` to allow :meth:`http_error_30\*` to perform the
return a new :class:`Request` to allow :meth:`!http_error_30\*` to perform the
redirect to *newurl*. Otherwise, raise :exc:`~urllib.error.HTTPError` if
no other handler should try to handle this URL, or return ``None`` if you
can't but another handler might.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/xml.dom.rst
Expand Up @@ -734,7 +734,7 @@ NamedNodeMap Objects
attribute node. Get its value with the :attr:`value` attribute.

There are also experimental methods that give this class more mapping behavior.
You can use them or you can use the standardized :meth:`getAttribute\*` family
You can use them or you can use the standardized :meth:`!getAttribute\*` family
of methods on the :class:`Element` objects.


Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/2.3.rst
Expand Up @@ -1362,7 +1362,7 @@ complete list of changes, or look through the CVS logs for all the details.
:mod:`os` module. (Contributed by Gustavo Niemeyer, Geert Jansen, and Denis S.
Otkidach.)

* In the :mod:`os` module, the :func:`\*stat` family of functions can now report
* In the :mod:`os` module, the :func:`!\*stat` family of functions can now report
fractions of a second in a timestamp. Such time stamps are represented as
floats, similar to the value returned by :func:`time.time`.

Expand Down

0 comments on commit 01bd133

Please sign in to comment.