Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4aeb95e

Browse files
committed
Merge branch 'main' into feature/os.timerfd_xxx
2 parents ae8c3da + 14098b7 commit 4aeb95e

263 files changed

Lines changed: 4879 additions & 3185 deletions

File tree

Some content is hidden

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

.github/workflows/build.yml

Lines changed: 9 additions & 12 deletions
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
@@ -182,7 +179,7 @@ jobs:
182179
- name: Display build info
183180
run: .\python.bat -m test.pythoninfo
184181
- name: Tests
185-
run: .\PCbuild\rt.bat -p Win32 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
182+
run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci
186183

187184
build_win_amd64:
188185
name: 'Windows (x64)'
@@ -201,7 +198,7 @@ jobs:
201198
- name: Display build info
202199
run: .\python.bat -m test.pythoninfo
203200
- name: Tests
204-
run: .\PCbuild\rt.bat -p x64 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
201+
run: .\PCbuild\rt.bat -p x64 -d -q --fast-ci
205202

206203
build_win_arm64:
207204
name: 'Windows (arm64)'
@@ -252,7 +249,7 @@ jobs:
252249
- name: Display build info
253250
run: make pythoninfo
254251
- name: Tests
255-
run: make buildbottest TESTOPTS="-j4 -uall,-cpu"
252+
run: make test
256253

257254
build_ubuntu:
258255
name: 'Ubuntu'
@@ -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
@@ -319,7 +316,7 @@ jobs:
319316
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
320317
- name: Tests
321318
working-directory: ${{ env.CPYTHON_BUILDDIR }}
322-
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
319+
run: xvfb-run make test
323320

324321
build_ubuntu_ssltests:
325322
name: 'Ubuntu SSL tests with OpenSSL'
@@ -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:
@@ -535,7 +532,7 @@ jobs:
535532
- name: Display build info
536533
run: make pythoninfo
537534
- name: Tests
538-
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
535+
run: xvfb-run make test
539536

540537
all-required-green: # This job does nothing and is only used for the branch protection
541538
name: All required checks pass

Doc/extending/windows.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,4 @@ modules (including Python) to be able to see your identifiers, you have to say
132132
Developer Studio will throw in a lot of import libraries that you do not really
133133
need, adding about 100K to your executable. To get rid of them, use the Project
134134
Settings dialog, Link tab, to specify *ignore default libraries*. Add the
135-
correct :file:`msvcrtxx.lib` to the list of libraries.
135+
correct :file:`msvcrt{xx}.lib` to the list of libraries.

Doc/howto/logging-cookbook.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,7 @@ when (and if) the logged message is actually about to be output to a log by a
17281728
handler. So the only slightly unusual thing which might trip you up is that the
17291729
parentheses go around the format string and the arguments, not just the format
17301730
string. That's because the __ notation is just syntax sugar for a constructor
1731-
call to one of the XXXMessage classes.
1731+
call to one of the :samp:`{XXX}Message` classes.
17321732

17331733
If you prefer, you can use a :class:`LoggerAdapter` to achieve a similar effect
17341734
to the above, as in the following example::
@@ -2644,7 +2644,7 @@ when (and if) the logged message is actually about to be output to a log by a
26442644
handler. So the only slightly unusual thing which might trip you up is that the
26452645
parentheses go around the format string and the arguments, not just the format
26462646
string. That’s because the __ notation is just syntax sugar for a constructor
2647-
call to one of the ``XXXMessage`` classes shown above.
2647+
call to one of the :samp:`{XXX}Message` classes shown above.
26482648

26492649

26502650
.. _filters-dictconfig:

Doc/howto/logging.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ provided:
979979

980980
#. :class:`NullHandler` instances do nothing with error messages. They are used
981981
by library developers who want to use logging, but want to avoid the 'No
982-
handlers could be found for logger XXX' message which can be displayed if
982+
handlers could be found for logger *XXX*' message which can be displayed if
983983
the library user has not configured logging. See :ref:`library-config` for
984984
more information.
985985

Doc/howto/urllib2.rst

Lines changed: 8 additions & 8 deletions
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/__future__.rst

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,48 @@
2222
can be inspected programmatically via importing :mod:`__future__` and examining
2323
its contents.
2424

25-
Each statement in :file:`__future__.py` is of the form::
25+
.. _future-classes:
2626

27-
FeatureName = _Feature(OptionalRelease, MandatoryRelease,
28-
CompilerFlag)
27+
.. class:: _Feature
2928

29+
Each statement in :file:`__future__.py` is of the form::
3030

31-
where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both are
32-
5-tuples of the same form as :data:`sys.version_info`::
31+
FeatureName = _Feature(OptionalRelease, MandatoryRelease,
32+
CompilerFlag)
3333

34-
(PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int
35-
PY_MINOR_VERSION, # the 1; an int
36-
PY_MICRO_VERSION, # the 0; an int
37-
PY_RELEASE_LEVEL, # "alpha", "beta", "candidate" or "final"; string
38-
PY_RELEASE_SERIAL # the 3; an int
39-
)
34+
where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both are
35+
5-tuples of the same form as :data:`sys.version_info`::
4036

41-
*OptionalRelease* records the first release in which the feature was accepted.
37+
(PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int
38+
PY_MINOR_VERSION, # the 1; an int
39+
PY_MICRO_VERSION, # the 0; an int
40+
PY_RELEASE_LEVEL, # "alpha", "beta", "candidate" or "final"; string
41+
PY_RELEASE_SERIAL # the 3; an int
42+
)
4243

43-
In the case of a *MandatoryRelease* that has not yet occurred,
44-
*MandatoryRelease* predicts the release in which the feature will become part of
45-
the language.
44+
.. method:: _Feature.getOptionalRelease()
4645

47-
Else *MandatoryRelease* records when the feature became part of the language; in
48-
releases at or after that, modules no longer need a future statement to use the
49-
feature in question, but may continue to use such imports.
46+
*OptionalRelease* records the first release in which the feature was accepted.
5047

51-
*MandatoryRelease* may also be ``None``, meaning that a planned feature got
52-
dropped.
48+
.. method:: _Feature.getMandatoryRelease()
5349

54-
Instances of class :class:`_Feature` have two corresponding methods,
55-
:meth:`getOptionalRelease` and :meth:`getMandatoryRelease`.
50+
In the case of a *MandatoryRelease* that has not yet occurred,
51+
*MandatoryRelease* predicts the release in which the feature will become part of
52+
the language.
5653

57-
*CompilerFlag* is the (bitfield) flag that should be passed in the fourth
58-
argument to the built-in function :func:`compile` to enable the feature in
59-
dynamically compiled code. This flag is stored in the :attr:`compiler_flag`
60-
attribute on :class:`_Feature` instances.
54+
Else *MandatoryRelease* records when the feature became part of the language; in
55+
releases at or after that, modules no longer need a future statement to use the
56+
feature in question, but may continue to use such imports.
57+
58+
*MandatoryRelease* may also be ``None``, meaning that a planned feature got
59+
dropped or that it is not yet decided.
60+
61+
.. attribute:: _Feature.compiler_flag
62+
63+
*CompilerFlag* is the (bitfield) flag that should be passed in the fourth
64+
argument to the built-in function :func:`compile` to enable the feature in
65+
dynamically compiled code. This flag is stored in the :attr:`_Feature.compiler_flag`
66+
attribute on :class:`_Feature` instances.
6167

6268
No feature description will ever be deleted from :mod:`__future__`. Since its
6369
introduction in Python 2.1 the following features have found their way into the

Doc/library/asyncio-stream.rst

Lines changed: 2 additions & 2 deletions
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

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,10 @@ The following error handlers can be used with all Python
345345
+-------------------------+-----------------------------------------------+
346346
| ``'backslashreplace'`` | Replace with backslashed escape sequences. |
347347
| | On encoding, use hexadecimal form of Unicode |
348-
| | code point with formats ``\xhh`` ``\uxxxx`` |
349-
| | ``\Uxxxxxxxx``. On decoding, use hexadecimal |
350-
| | form of byte value with format ``\xhh``. |
348+
| | code point with formats :samp:`\\x{hh}` |
349+
| | :samp:`\\u{xxxx}` :samp:`\\U{xxxxxxxx}`. |
350+
| | On decoding, use hexadecimal form of byte |
351+
| | value with format :samp:`\\x{hh}`. |
351352
| | Implemented in |
352353
| | :func:`backslashreplace_errors`. |
353354
+-------------------------+-----------------------------------------------+
@@ -373,8 +374,9 @@ The following error handlers are only applicable to encoding (within
373374
+=========================+===============================================+
374375
| ``'xmlcharrefreplace'`` | Replace with XML/HTML numeric character |
375376
| | reference, which is a decimal form of Unicode |
376-
| | code point with format ``&#num;`` Implemented |
377-
| | in :func:`xmlcharrefreplace_errors`. |
377+
| | code point with format :samp:`&#{num};`. |
378+
| | Implemented in |
379+
| | :func:`xmlcharrefreplace_errors`. |
378380
+-------------------------+-----------------------------------------------+
379381
| ``'namereplace'`` | Replace with ``\N{...}`` escape sequences, |
380382
| | what appears in the braces is the Name |
@@ -478,8 +480,9 @@ functions:
478480

479481
Malformed data is replaced by a backslashed escape sequence.
480482
On encoding, use the hexadecimal form of Unicode code point with formats
481-
``\xhh`` ``\uxxxx`` ``\Uxxxxxxxx``. On decoding, use the hexadecimal form of
482-
byte value with format ``\xhh``.
483+
:samp:`\\x{hh}` :samp:`\\u{xxxx}` :samp:`\\U{xxxxxxxx}`.
484+
On decoding, use the hexadecimal form of
485+
byte value with format :samp:`\\x{hh}`.
483486

484487
.. versionchanged:: 3.5
485488
Works with decoding and translating.
@@ -492,7 +495,7 @@ functions:
492495

493496
The unencodable character is replaced by an appropriate XML/HTML numeric
494497
character reference, which is a decimal form of Unicode code point with
495-
format ``&#num;`` .
498+
format :samp:`&#{num};` .
496499

497500

498501
.. function:: namereplace_errors(exception)
@@ -1346,9 +1349,10 @@ encodings.
13461349
| | | supported. |
13471350
+--------------------+---------+---------------------------+
13481351
| raw_unicode_escape | | Latin-1 encoding with |
1349-
| | | ``\uXXXX`` and |
1350-
| | | ``\UXXXXXXXX`` for other |
1351-
| | | code points. Existing |
1352+
| | | :samp:`\\u{XXXX}` and |
1353+
| | | :samp:`\\U{XXXXXXXX}` |
1354+
| | | for other code points. |
1355+
| | | Existing |
13521356
| | | backslashes are not |
13531357
| | | escaped in any way. |
13541358
| | | It is used in the Python |

Doc/library/collections.rst

Lines changed: 1 addition & 1 deletion
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/compileall.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ compile Python sources.
3131

3232
Positional arguments are files to compile or directories that contain
3333
source files, traversed recursively. If no argument is given, behave as if
34-
the command line was ``-l <directories from sys.path>``.
34+
the command line was :samp:`-l {<directories from sys.path>}`.
3535

3636
.. cmdoption:: -l
3737

0 commit comments

Comments
 (0)