Skip to content

Commit 9cb2952

Browse files
committed
Merge branch 'main' into pythongh-72904-fnmatch-seps
2 parents c70afe3 + 89966a6 commit 9cb2952

File tree

162 files changed

+4196
-2596
lines changed

Some content is hidden

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

162 files changed

+4196
-2596
lines changed

.github/workflows/build.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ jobs:
140140
run: make regen-configure
141141
- name: Build CPython
142142
run: |
143-
# Deepfreeze will usually cause global objects to be added or removed,
144-
# so we run it before regen-global-objects gets rum (in regen-all).
145-
make regen-deepfreeze
146143
make -j4 regen-all
147144
make regen-stdlib-module-names
148145
- name: Check for changes
@@ -261,7 +258,7 @@ jobs:
261258
needs: check_source
262259
if: needs.check_source.outputs.run_tests == 'true'
263260
env:
264-
OPENSSL_VER: 1.1.1v
261+
OPENSSL_VER: 3.0.11
265262
PYTHONSTRICTEXTENSIONBUILD: 1
266263
steps:
267264
- uses: actions/checkout@v4
@@ -330,7 +327,7 @@ jobs:
330327
strategy:
331328
fail-fast: false
332329
matrix:
333-
openssl_ver: [1.1.1v, 3.0.10, 3.1.2]
330+
openssl_ver: [1.1.1w, 3.0.11, 3.1.3]
334331
env:
335332
OPENSSL_VER: ${{ matrix.openssl_ver }}
336333
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -382,7 +379,7 @@ jobs:
382379
needs: check_source
383380
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
384381
env:
385-
OPENSSL_VER: 1.1.1v
382+
OPENSSL_VER: 3.0.11
386383
PYTHONSTRICTEXTENSIONBUILD: 1
387384
steps:
388385
- uses: actions/checkout@v4
@@ -491,7 +488,7 @@ jobs:
491488
needs: check_source
492489
if: needs.check_source.outputs.run_tests == 'true'
493490
env:
494-
OPENSSL_VER: 1.1.1v
491+
OPENSSL_VER: 3.0.11
495492
PYTHONSTRICTEXTENSIONBUILD: 1
496493
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
497494
steps:

Doc/howto/urllib2.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ which comes after we have a look at what happens when things go wrong.
194194
Handling Exceptions
195195
===================
196196

197-
*urlopen* raises :exc:`URLError` when it cannot handle a response (though as
197+
*urlopen* raises :exc:`~urllib.error.URLError` when it cannot handle a response (though as
198198
usual with Python APIs, built-in exceptions such as :exc:`ValueError`,
199199
:exc:`TypeError` etc. may also be raised).
200200

201-
:exc:`HTTPError` is the subclass of :exc:`URLError` raised in the specific case of
201+
:exc:`~urllib.error.HTTPError` is the subclass of :exc:`~urllib.error.URLError` raised in the specific case of
202202
HTTP URLs.
203203

204204
The exception classes are exported from the :mod:`urllib.error` module.
@@ -229,12 +229,12 @@ the status code indicates that the server is unable to fulfil the request. The
229229
default handlers will handle some of these responses for you (for example, if
230230
the response is a "redirection" that requests the client fetch the document from
231231
a different URL, urllib will handle that for you). For those it can't handle,
232-
urlopen will raise an :exc:`HTTPError`. Typical errors include '404' (page not
232+
urlopen will raise an :exc:`~urllib.error.HTTPError`. Typical errors include '404' (page not
233233
found), '403' (request forbidden), and '401' (authentication required).
234234

235235
See section 10 of :rfc:`2616` for a reference on all the HTTP error codes.
236236

237-
The :exc:`HTTPError` instance raised will have an integer 'code' attribute, which
237+
The :exc:`~urllib.error.HTTPError` instance raised will have an integer 'code' attribute, which
238238
corresponds to the error sent by the server.
239239

240240
Error Codes
@@ -317,7 +317,7 @@ dictionary is reproduced here for convenience ::
317317
}
318318

319319
When an error is raised the server responds by returning an HTTP error code
320-
*and* an error page. You can use the :exc:`HTTPError` instance as a response on the
320+
*and* an error page. You can use the :exc:`~urllib.error.HTTPError` instance as a response on the
321321
page returned. This means that as well as the code attribute, it also has read,
322322
geturl, and info, methods as returned by the ``urllib.response`` module::
323323

@@ -338,7 +338,7 @@ geturl, and info, methods as returned by the ``urllib.response`` module::
338338
Wrapping it Up
339339
--------------
340340

341-
So if you want to be prepared for :exc:`HTTPError` *or* :exc:`URLError` there are two
341+
So if you want to be prepared for :exc:`~urllib.error.HTTPError` *or* :exc:`~urllib.error.URLError` there are two
342342
basic approaches. I prefer the second approach.
343343

344344
Number 1
@@ -365,7 +365,7 @@ Number 1
365365
.. note::
366366

367367
The ``except HTTPError`` *must* come first, otherwise ``except URLError``
368-
will *also* catch an :exc:`HTTPError`.
368+
will *also* catch an :exc:`~urllib.error.HTTPError`.
369369

370370
Number 2
371371
~~~~~~~~
@@ -391,7 +391,7 @@ Number 2
391391
info and geturl
392392
===============
393393

394-
The response returned by urlopen (or the :exc:`HTTPError` instance) has two
394+
The response returned by urlopen (or the :exc:`~urllib.error.HTTPError` instance) has two
395395
useful methods :meth:`info` and :meth:`geturl` and is defined in the module
396396
:mod:`urllib.response`..
397397

Doc/library/asyncio-stream.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ and work with streams:
157157
.. versionchanged:: 3.10
158158
Removed the *loop* parameter.
159159

160-
.. versionchanged:: 3.11
161-
Added the *ssl_shutdown_timeout* parameter.
160+
.. versionchanged:: 3.11
161+
Added the *ssl_shutdown_timeout* parameter.
162162

163163

164164
.. coroutinefunction:: start_unix_server(client_connected_cb, path=None, \

Doc/library/codecs.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ encodings.
13501350
+--------------------+---------+---------------------------+
13511351
| raw_unicode_escape | | Latin-1 encoding with |
13521352
| | | :samp:`\\u{XXXX}` and |
1353-
| | | :samp:`\\U{XXXXXXXX}`` |
1353+
| | | :samp:`\\U{XXXXXXXX}` |
13541354
| | | for other code points. |
13551355
| | | Existing |
13561356
| | | backslashes are not |

Doc/library/collections.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ Common patterns for working with :class:`Counter` objects::
358358
list(c) # list unique elements
359359
set(c) # convert to a set
360360
dict(c) # convert to a regular dictionary
361-
c.items() # convert to a list of (elem, cnt) pairs
361+
c.items() # access the (elem, cnt) pairs
362362
Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs
363363
c.most_common()[:-n-1:-1] # n least common elements
364364
+c # remove zero and negative counts

Doc/library/copy.rst

+25-13
Original file line numberDiff line numberDiff line change
@@ -87,28 +87,40 @@ pickle functions from the :mod:`copyreg` module.
8787
single: __copy__() (copy protocol)
8888
single: __deepcopy__() (copy protocol)
8989

90+
.. currentmodule:: None
91+
9092
In order for a class to define its own copy implementation, it can define
91-
special methods :meth:`__copy__` and :meth:`__deepcopy__`. The former is called
92-
to implement the shallow copy operation; no additional arguments are passed.
93-
The latter is called to implement the deep copy operation; it is passed one
94-
argument, the ``memo`` dictionary. If the :meth:`__deepcopy__` implementation needs
95-
to make a deep copy of a component, it should call the :func:`deepcopy` function
96-
with the component as first argument and the memo dictionary as second argument.
97-
The memo dictionary should be treated as an opaque object.
93+
special methods :meth:`~object.__copy__` and :meth:`~object.__deepcopy__`.
94+
95+
.. method:: object.__copy__(self)
96+
:noindexentry:
97+
98+
Called to implement the shallow copy operation;
99+
no additional arguments are passed.
100+
101+
.. method:: object.__deepcopy__(self, memo)
102+
:noindexentry:
103+
104+
Called to implement the deep copy operation; it is passed one
105+
argument, the *memo* dictionary. If the ``__deepcopy__`` implementation needs
106+
to make a deep copy of a component, it should call the :func:`~copy.deepcopy` function
107+
with the component as first argument and the *memo* dictionary as second argument.
108+
The *memo* dictionary should be treated as an opaque object.
98109

99110

100111
.. index::
101112
single: __replace__() (replace protocol)
102113

103-
Function :func:`replace` is more limited than :func:`copy` and :func:`deepcopy`,
114+
Function :func:`!copy.replace` is more limited
115+
than :func:`~copy.copy` and :func:`~copy.deepcopy`,
104116
and only supports named tuples created by :func:`~collections.namedtuple`,
105-
:mod:`dataclasses`, and other classes which define method :meth:`!__replace__`.
117+
:mod:`dataclasses`, and other classes which define method :meth:`~object.__replace__`.
106118

107-
.. method:: __replace__(self, /, **changes)
108-
:noindex:
119+
.. method:: object.__replace__(self, /, **changes)
120+
:noindexentry:
109121

110-
:meth:`!__replace__` should create a new object of the same type,
111-
replacing fields with values from *changes*.
122+
This method should create a new object of the same type,
123+
replacing fields with values from *changes*.
112124

113125

114126
.. seealso::

Doc/library/devmode.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ Effects of the Python Development Mode:
5959
``default``.
6060

6161
* Call :func:`faulthandler.enable` at Python startup to install handlers for
62-
the :const:`SIGSEGV`, :const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` and
63-
:const:`SIGILL` signals to dump the Python traceback on a crash.
62+
the :const:`~signal.SIGSEGV`, :const:`~signal.SIGFPE`,
63+
:const:`~signal.SIGABRT`, :const:`~signal.SIGBUS` and
64+
:const:`~signal.SIGILL` signals to dump the Python traceback on a crash.
6465

6566
It behaves as if the :option:`-X faulthandler <-X>` command line option is
6667
used or if the :envvar:`PYTHONFAULTHANDLER` environment variable is set to

Doc/library/difflib.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,8 @@ The :class:`SequenceMatcher` class has this constructor:
570570

571571
The three methods that return the ratio of matching to total characters can give
572572
different results due to differing levels of approximation, although
573-
:meth:`quick_ratio` and :meth:`real_quick_ratio` are always at least as large as
574-
:meth:`ratio`:
573+
:meth:`~SequenceMatcher.quick_ratio` and :meth:`~SequenceMatcher.real_quick_ratio`
574+
are always at least as large as :meth:`~SequenceMatcher.ratio`:
575575

576576
>>> s = SequenceMatcher(None, "abcd", "bcde")
577577
>>> s.ratio()
@@ -593,28 +593,28 @@ This example compares two strings, considering blanks to be "junk":
593593
... "private Thread currentThread;",
594594
... "private volatile Thread currentThread;")
595595

596-
:meth:`ratio` returns a float in [0, 1], measuring the similarity of the
597-
sequences. As a rule of thumb, a :meth:`ratio` value over 0.6 means the
596+
:meth:`~SequenceMatcher.ratio` returns a float in [0, 1], measuring the similarity of the
597+
sequences. As a rule of thumb, a :meth:`~SequenceMatcher.ratio` value over 0.6 means the
598598
sequences are close matches:
599599

600600
>>> print(round(s.ratio(), 3))
601601
0.866
602602

603603
If you're only interested in where the sequences match,
604-
:meth:`get_matching_blocks` is handy:
604+
:meth:`~SequenceMatcher.get_matching_blocks` is handy:
605605

606606
>>> for block in s.get_matching_blocks():
607607
... print("a[%d] and b[%d] match for %d elements" % block)
608608
a[0] and b[0] match for 8 elements
609609
a[8] and b[17] match for 21 elements
610610
a[29] and b[38] match for 0 elements
611611

612-
Note that the last tuple returned by :meth:`get_matching_blocks` is always a
613-
dummy, ``(len(a), len(b), 0)``, and this is the only case in which the last
612+
Note that the last tuple returned by :meth:`~SequenceMatcher.get_matching_blocks`
613+
is always a dummy, ``(len(a), len(b), 0)``, and this is the only case in which the last
614614
tuple element (number of elements matched) is ``0``.
615615

616616
If you want to know how to change the first sequence into the second, use
617-
:meth:`get_opcodes`:
617+
:meth:`~SequenceMatcher.get_opcodes`:
618618

619619
>>> for opcode in s.get_opcodes():
620620
... print("%6s a[%d:%d] b[%d:%d]" % opcode)
@@ -689,7 +689,7 @@ Differ Example
689689

690690
This example compares two texts. First we set up the texts, sequences of
691691
individual single-line strings ending with newlines (such sequences can also be
692-
obtained from the :meth:`~io.BaseIO.readlines` method of file-like objects):
692+
obtained from the :meth:`~io.IOBase.readlines` method of file-like objects):
693693

694694
>>> text1 = ''' 1. Beautiful is better than ugly.
695695
... 2. Explicit is better than implicit.

0 commit comments

Comments
 (0)