Skip to content

Commit 5aae7a2

Browse files
committed
Merge branch 'main' into pythongh-72904-fnmatch-seps
2 parents 4c6d6f0 + a829356 commit 5aae7a2

90 files changed

Lines changed: 1205 additions & 618 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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ jobs:
182182
- name: Display build info
183183
run: .\python.bat -m test.pythoninfo
184184
- name: Tests
185-
run: .\PCbuild\rt.bat -p Win32 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
185+
run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci
186186

187187
build_win_amd64:
188188
name: 'Windows (x64)'
@@ -201,7 +201,7 @@ jobs:
201201
- name: Display build info
202202
run: .\python.bat -m test.pythoninfo
203203
- name: Tests
204-
run: .\PCbuild\rt.bat -p x64 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
204+
run: .\PCbuild\rt.bat -p x64 -d -q --fast-ci
205205

206206
build_win_arm64:
207207
name: 'Windows (arm64)'
@@ -252,7 +252,7 @@ jobs:
252252
- name: Display build info
253253
run: make pythoninfo
254254
- name: Tests
255-
run: make buildbottest TESTOPTS="-j4 -uall,-cpu"
255+
run: make test
256256

257257
build_ubuntu:
258258
name: 'Ubuntu'
@@ -319,7 +319,7 @@ jobs:
319319
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
320320
- name: Tests
321321
working-directory: ${{ env.CPYTHON_BUILDDIR }}
322-
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
322+
run: xvfb-run make test
323323

324324
build_ubuntu_ssltests:
325325
name: 'Ubuntu SSL tests with OpenSSL'
@@ -535,7 +535,7 @@ jobs:
535535
- name: Display build info
536536
run: make pythoninfo
537537
- name: Tests
538-
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
538+
run: xvfb-run make test
539539

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

‎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/pathlib.rst‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,15 +1381,19 @@ call fails (for example because the path doesn't exist).
13811381
>>> p.resolve()
13821382
PosixPath('/home/antoine/pathlib/setup.py')
13831383

1384-
If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError`
1385-
is raised. If *strict* is ``False``, the path is resolved as far as possible
1386-
and any remainder is appended without checking whether it exists. If an
1387-
infinite loop is encountered along the resolution path, :exc:`RuntimeError`
1388-
is raised.
1384+
If a path doesn't exist or a symlink loop is encountered, and *strict* is
1385+
``True``, :exc:`OSError` is raised. If *strict* is ``False``, the path is
1386+
resolved as far as possible and any remainder is appended without checking
1387+
whether it exists.
13891388

13901389
.. versionchanged:: 3.6
13911390
The *strict* parameter was added (pre-3.6 behavior is strict).
13921391

1392+
.. versionchanged:: 3.13
1393+
Symlink loops are treated like other errors: :exc:`OSError` is raised in
1394+
strict mode, and no exception is raised in non-strict mode. In previous
1395+
versions, :exc:`RuntimeError` is raised no matter the value of *strict*.
1396+
13931397
.. method:: Path.rglob(pattern, *, case_sensitive=None, follow_symlinks=None)
13941398

13951399
Glob the given relative *pattern* recursively. This is like calling

‎Doc/library/types.rst‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,12 @@ Standard names are defined for the following types:
472472

473473
.. versionadded:: 3.12
474474

475+
.. class:: CapsuleType
476+
477+
The type of :ref:`capsule objects <capsules>`.
478+
479+
.. versionadded:: 3.13
480+
475481

476482
Additional Utility Classes and Functions
477483
----------------------------------------

‎Doc/library/weakref.rst‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ See :ref:`__slots__ documentation <slots>` for details.
111111

112112
Exceptions raised by the callback will be noted on the standard error output,
113113
but cannot be propagated; they are handled in exactly the same way as exceptions
114-
raised from an object's :meth:`__del__` method.
114+
raised from an object's :meth:`~object.__del__` method.
115115

116116
Weak references are :term:`hashable` if the *object* is hashable. They will
117117
maintain their hash value even after the *object* was deleted. If
@@ -221,8 +221,7 @@ than needed.
221221
Added support for ``|`` and ``|=`` operators, as specified in :pep:`584`.
222222

223223
:class:`WeakValueDictionary` objects have an additional method that has the
224-
same issues as the :meth:`keyrefs` method of :class:`WeakKeyDictionary`
225-
objects.
224+
same issues as the :meth:`WeakKeyDictionary.keyrefs` method.
226225

227226

228227
.. method:: WeakValueDictionary.valuerefs()
@@ -281,7 +280,7 @@ objects.
281280
Exceptions raised by finalizer callbacks during garbage collection
282281
will be shown on the standard error output, but cannot be
283282
propagated. They are handled in the same way as exceptions raised
284-
from an object's :meth:`__del__` method or a weak reference's
283+
from an object's :meth:`~object.__del__` method or a weak reference's
285284
callback.
286285

287286
When the program exits, each remaining live finalizer is called
@@ -523,18 +522,18 @@ is still alive. For instance
523522
obj dead or exiting
524523

525524

526-
Comparing finalizers with :meth:`__del__` methods
527-
-------------------------------------------------
525+
Comparing finalizers with :meth:`~object.__del__` methods
526+
---------------------------------------------------------
528527

529528
Suppose we want to create a class whose instances represent temporary
530529
directories. The directories should be deleted with their contents
531530
when the first of the following events occurs:
532531

533532
* the object is garbage collected,
534-
* the object's :meth:`remove` method is called, or
533+
* the object's :meth:`!remove` method is called, or
535534
* the program exits.
536535

537-
We might try to implement the class using a :meth:`__del__` method as
536+
We might try to implement the class using a :meth:`~object.__del__` method as
538537
follows::
539538

540539
class TempDir:
@@ -553,12 +552,12 @@ follows::
553552
def __del__(self):
554553
self.remove()
555554

556-
Starting with Python 3.4, :meth:`__del__` methods no longer prevent
555+
Starting with Python 3.4, :meth:`~object.__del__` methods no longer prevent
557556
reference cycles from being garbage collected, and module globals are
558557
no longer forced to :const:`None` during :term:`interpreter shutdown`.
559558
So this code should work without any issues on CPython.
560559

561-
However, handling of :meth:`__del__` methods is notoriously implementation
560+
However, handling of :meth:`~object.__del__` methods is notoriously implementation
562561
specific, since it depends on internal details of the interpreter's garbage
563562
collector implementation.
564563

‎Doc/library/xml.etree.elementtree.rst‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ for parsing and creating XML data.
1717
This module will use a fast implementation whenever available.
1818

1919
.. deprecated:: 3.3
20-
The :mod:`xml.etree.cElementTree` module is deprecated.
20+
The :mod:`!xml.etree.cElementTree` module is deprecated.
2121

2222

2323
.. warning::
@@ -825,6 +825,8 @@ Reference
825825
Functions
826826
^^^^^^^^^
827827

828+
.. module:: xml.etree.ElementInclude
829+
828830
.. function:: xml.etree.ElementInclude.default_loader( href, parse, encoding=None)
829831
:module:
830832

@@ -862,6 +864,9 @@ Functions
862864
Element Objects
863865
^^^^^^^^^^^^^^^
864866

867+
.. module:: xml.etree.ElementTree
868+
:noindex:
869+
865870
.. class:: Element(tag, attrib={}, **extra)
866871

867872
Element class. This class defines the Element interface, and provides a

‎Doc/tools/.nitignore‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Doc/howto/enum.rst
2828
Doc/howto/isolating-extensions.rst
2929
Doc/howto/logging.rst
3030
Doc/howto/urllib2.rst
31-
Doc/library/__future__.rst
3231
Doc/library/abc.rst
3332
Doc/library/ast.rst
3433
Doc/library/asyncio-dev.rst
@@ -134,12 +133,10 @@ Doc/library/unittest.mock.rst
134133
Doc/library/unittest.rst
135134
Doc/library/urllib.parse.rst
136135
Doc/library/urllib.request.rst
137-
Doc/library/weakref.rst
138136
Doc/library/wsgiref.rst
139137
Doc/library/xml.dom.minidom.rst
140138
Doc/library/xml.dom.pulldom.rst
141139
Doc/library/xml.dom.rst
142-
Doc/library/xml.etree.elementtree.rst
143140
Doc/library/xml.rst
144141
Doc/library/xml.sax.handler.rst
145142
Doc/library/xml.sax.reader.rst

‎Doc/using/configure.rst‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -964,9 +964,18 @@ Main Makefile targets
964964
You can use the configure :option:`--enable-optimizations` option to make
965965
this the default target of the ``make`` command (``make all`` or just
966966
``make``).
967-
* ``make buildbottest``: Build Python and run the Python test suite, the same
968-
way than buildbots test Python. Set ``TESTTIMEOUT`` variable (in seconds)
969-
to change the test timeout (1200 by default: 20 minutes).
967+
968+
* ``make test``: Build Python and run the Python test suite with ``--fast-ci``
969+
option. Variables:
970+
971+
* ``TESTOPTS``: additional regrtest command line options.
972+
* ``TESTPYTHONOPTS``: additional Python command line options.
973+
* ``TESTTIMEOUT``: timeout in seconds (default: 20 minutes).
974+
975+
* ``make buildbottest``: Similar to ``make test``, but use ``--slow-ci``
976+
option and default timeout of 20 minutes, instead of ``--fast-ci`` option
977+
and a default timeout of 10 minutes.
978+
970979
* ``make install``: Build and install Python.
971980
* ``make regen-all``: Regenerate (almost) all generated files;
972981
``make regen-stdlib-module-names`` and ``autoconf`` must be run separately

0 commit comments

Comments
 (0)