Skip to content

Commit 01bd133

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pythongh-86179
2 parents d37c113 + 79dad03 commit 01bd133

File tree

86 files changed

+920
-315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+920
-315
lines changed

.github/workflows/reusable-windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818
- name: Build CPython
19-
run: .\PCbuild\build.bat -e -d -p Win32 ${{ inputs.free-threaded && '--disable-gil' || '' }}
19+
run: .\PCbuild\build.bat -e -d -v -p Win32 ${{ inputs.free-threaded && '--disable-gil' || '' }}
2020
- name: Display build info
2121
run: .\python.bat -m test.pythoninfo
2222
- name: Tests
@@ -33,7 +33,7 @@ jobs:
3333
- name: Register MSVC problem matcher
3434
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
3535
- name: Build CPython
36-
run: .\PCbuild\build.bat -e -d -p x64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
36+
run: .\PCbuild\build.bat -e -d -v -p x64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
3737
- name: Display build info
3838
run: .\python.bat -m test.pythoninfo
3939
- name: Tests
@@ -50,4 +50,4 @@ jobs:
5050
- name: Register MSVC problem matcher
5151
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
5252
- name: Build CPython
53-
run: .\PCbuild\build.bat -e -d -p arm64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
53+
run: .\PCbuild\build.bat -e -d -v -p arm64 ${{ inputs.free-threaded && '--disable-gil' || '' }}

Doc/library/asyncio-eventloop.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@ Creating network servers
671671
flags=socket.AI_PASSIVE, \
672672
sock=None, backlog=100, ssl=None, \
673673
reuse_address=None, reuse_port=None, \
674+
keep_alive=None, \
674675
ssl_handshake_timeout=None, \
675676
ssl_shutdown_timeout=None, \
676677
start_serving=True)
@@ -735,6 +736,13 @@ Creating network servers
735736
set this flag when being created. This option is not supported on
736737
Windows.
737738

739+
* *keep_alive* set to ``True`` keeps connections active by enabling the
740+
periodic transmission of messages.
741+
742+
.. versionchanged:: 3.13
743+
744+
Added the *keep_alive* parameter.
745+
738746
* *ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait
739747
for the TLS handshake to complete before aborting the connection.
740748
``60.0`` seconds if ``None`` (default).

Doc/library/bdb.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ The :mod:`bdb` module also defines two classes:
294294
.. method:: set_quit()
295295

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

299299

300300
Derived classes and clients can call the following methods to manipulate

Doc/library/cmd.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ A :class:`Cmd` instance has the following methods:
8383

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

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

104104

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

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

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

133133

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

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

215215

216216
.. attribute:: Cmd.undoc_header
217217

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

222222

Doc/library/configparser.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ ConfigParser Objects
955955
When *converters* is given, it should be a dictionary where each key
956956
represents the name of a type converter and each value is a callable
957957
implementing the conversion from string to the desired datatype. Every
958-
converter gets its own corresponding :meth:`get*()` method on the parser
958+
converter gets its own corresponding :meth:`!get*()` method on the parser
959959
object and section proxies.
960960

961961
.. versionchanged:: 3.1

Doc/library/csv.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ An example for :class:`Sniffer` use::
309309
# ... process CSV file contents here ...
310310

311311

312+
.. _csv-constants:
313+
312314
The :mod:`csv` module defines the following constants:
313315

314316
.. data:: QUOTE_ALL
@@ -432,8 +434,8 @@ Dialects support the following attributes:
432434
.. attribute:: Dialect.quoting
433435

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

438440

439441
.. attribute:: Dialect.skipinitialspace

Doc/library/dis.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,17 @@ operation is being performed, so the intermediate analysis object isn't useful:
328328
source line information (if any) is taken directly from the disassembled code
329329
object.
330330

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

333333
.. versionadded:: 3.4
334334

335335
.. versionchanged:: 3.11
336336
Added the *show_caches* and *adaptive* parameters.
337337

338+
.. versionchanged:: 3.13
339+
The *show_caches* parameter is deprecated and has no effect. The *cache_info*
340+
field of each instruction is populated regardless of its value.
341+
338342

339343
.. function:: findlinestarts(code)
340344

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

489+
.. data::cache_info
490+
491+
Information about the cache entries of this instruction, as
492+
triplets of the form ``(name, size, data)``, where the ``name``
493+
and ``size`` describe the cache format and data is the contents
494+
of the cache. ``cache_info`` is ``None`` if the instruction does not have
495+
caches.
496+
485497
.. versionadded:: 3.4
486498

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

495507
Added fields ``start_offset``, ``cache_offset``, ``end_offset``,
496-
``baseopname``, ``baseopcode``, ``jump_target``, ``oparg``, and
497-
``line_number``.
508+
``baseopname``, ``baseopcode``, ``jump_target``, ``oparg``,
509+
``line_number`` and ``cache_info``.
498510

499511

500512
.. class:: Positions

Doc/library/http.server.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ provides three different variants:
6565

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

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

@@ -187,13 +187,13 @@ provides three different variants:
187187

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

193193
.. method:: handle_one_request()
194194

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

198198
.. method:: handle_expect_100()
199199

Doc/library/locale.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ The :mod:`locale` module defines the following exception and functions:
309309
.. function:: getlocale(category=LC_CTYPE)
310310

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

315315
Except for the code ``'C'``, the language code corresponds to :rfc:`1766`.

Doc/library/os.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4170,7 +4170,7 @@ to be ignored.
41704170
The "l" and "v" variants of the :func:`exec\* <execl>` functions differ in how
41714171
command-line arguments are passed. The "l" variants are perhaps the easiest
41724172
to work with if the number of parameters is fixed when the code is written; the
4173-
individual parameters simply become additional parameters to the :func:`execl\*`
4173+
individual parameters simply become additional parameters to the :func:`!execl\*`
41744174
functions. The "v" variants are good when the number of parameters is
41754175
variable, with the arguments being passed in a list or tuple as the *args*
41764176
parameter. In either case, the arguments to the child process should start with
@@ -4708,7 +4708,7 @@ written in Python, such as a mail server's external command delivery program.
47084708
command-line arguments are passed. The "l" variants are perhaps the easiest
47094709
to work with if the number of parameters is fixed when the code is written; the
47104710
individual parameters simply become additional parameters to the
4711-
:func:`spawnl\*` functions. The "v" variants are good when the number of
4711+
:func:`!spawnl\*` functions. The "v" variants are good when the number of
47124712
parameters is variable, with the arguments being passed in a list or tuple as
47134713
the *args* parameter. In either case, the arguments to the child process must
47144714
start with the name of the command being run.
@@ -4758,7 +4758,7 @@ written in Python, such as a mail server's external command delivery program.
47584758
P_NOWAITO
47594759

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

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

47704770
Possible value for the *mode* parameter to the :func:`spawn\* <spawnl>` family of
4771-
functions. If this is given as *mode*, the :func:`spawn\*` functions will not
4771+
functions. If this is given as *mode*, the :func:`spawn\* <spawnl>` functions will not
47724772
return until the new process has run to completion and will return the exit code
47734773
of the process the run is successful, or ``-signal`` if a signal kills the
47744774
process.

Doc/library/resource.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ These functions are used to retrieve resource usage information:
277277

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

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

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

359359

Doc/library/socket.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ Exceptions
311311
The accompanying value is a pair ``(error, string)`` representing an error
312312
returned by a library call. *string* represents the description of
313313
*error*, as returned by the :c:func:`gai_strerror` C function. The
314-
numeric *error* value will match one of the :const:`EAI_\*` constants
314+
numeric *error* value will match one of the :const:`!EAI_\*` constants
315315
defined in this module.
316316

317317
.. versionchanged:: 3.3
@@ -1517,7 +1517,7 @@ to sockets.
15171517
.. method:: socket.getsockopt(level, optname[, buflen])
15181518

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

19391939
Set the value of the given socket option (see the Unix manual page
1940-
:manpage:`setsockopt(2)`). The needed symbolic constants are defined in the
1941-
:mod:`socket` module (:const:`SO_\*` etc.). The value can be an integer,
1940+
:manpage:`setsockopt(2)`). The needed symbolic constants are defined in this
1941+
module (:ref:`!SO_\* etc. <socket-unix-constants>`). The value can be an integer,
19421942
``None`` or a :term:`bytes-like object` representing a buffer. In the later
19431943
case it is up to the caller to ensure that the bytestring contains the
19441944
proper bits (see the optional built-in module :mod:`struct` for a way to

Doc/library/unittest.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ testing code::
390390
widget = Widget('The widget')
391391
self.assertEqual(widget.size(), (50, 50))
392392

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

1943-
This affects :meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*`
1943+
This affects :meth:`getTestCaseNames` and all the ``loadTestsFrom*``
19441944
methods.
19451945

19461946

19471947
.. attribute:: sortTestMethodsUsing
19481948

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

19521952

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

1959-
This affects all the :meth:`loadTestsFrom\*` methods.
1959+
This affects all the ``loadTestsFrom*`` methods.
19601960

19611961
.. attribute:: testNamePatterns
19621962

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

1972-
This affects all the :meth:`loadTestsFrom\*` methods.
1972+
This affects all the ``loadTestsFrom*`` methods.
19731973

19741974
.. versionadded:: 3.7
19751975

@@ -2003,7 +2003,7 @@ Loading and running tests
20032003

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

20082008
.. attribute:: skipped
20092009

Doc/library/urllib.request.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,8 @@ The following attribute and methods should only be used by classes derived from
712712
.. note::
713713

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

718718

719719
.. attribute:: BaseHandler.parent
@@ -833,9 +833,9 @@ HTTPRedirectHandler Objects
833833
.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl)
834834

835835
Return a :class:`Request` or ``None`` in response to a redirect. This is called
836-
by the default implementations of the :meth:`http_error_30\*` methods when a
836+
by the default implementations of the :meth:`!http_error_30\*` methods when a
837837
redirection is received from the server. If a redirection should take place,
838-
return a new :class:`Request` to allow :meth:`http_error_30\*` to perform the
838+
return a new :class:`Request` to allow :meth:`!http_error_30\*` to perform the
839839
redirect to *newurl*. Otherwise, raise :exc:`~urllib.error.HTTPError` if
840840
no other handler should try to handle this URL, or return ``None`` if you
841841
can't but another handler might.

Doc/library/xml.dom.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ NamedNodeMap Objects
734734
attribute node. Get its value with the :attr:`value` attribute.
735735

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

740740

Doc/whatsnew/2.3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ complete list of changes, or look through the CVS logs for all the details.
13621362
:mod:`os` module. (Contributed by Gustavo Niemeyer, Geert Jansen, and Denis S.
13631363
Otkidach.)
13641364

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

0 commit comments

Comments
 (0)