Skip to content

Commit

Permalink
Merge branch 'main' into pythongh-72904-fnmatch-seps
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Sep 26, 2023
2 parents 4c6d6f0 + a829356 commit 5aae7a2
Show file tree
Hide file tree
Showing 90 changed files with 1,205 additions and 618 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
- name: Display build info
run: .\python.bat -m test.pythoninfo
- name: Tests
run: .\PCbuild\rt.bat -p Win32 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci

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

build_win_arm64:
name: 'Windows (arm64)'
Expand Down Expand Up @@ -252,7 +252,7 @@ jobs:
- name: Display build info
run: make pythoninfo
- name: Tests
run: make buildbottest TESTOPTS="-j4 -uall,-cpu"
run: make test

build_ubuntu:
name: 'Ubuntu'
Expand Down Expand Up @@ -319,7 +319,7 @@ jobs:
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
- name: Tests
working-directory: ${{ env.CPYTHON_BUILDDIR }}
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
run: xvfb-run make test

build_ubuntu_ssltests:
name: 'Ubuntu SSL tests with OpenSSL'
Expand Down Expand Up @@ -535,7 +535,7 @@ jobs:
- name: Display build info
run: make pythoninfo
- name: Tests
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
run: xvfb-run make test

all-required-green: # This job does nothing and is only used for the branch protection
name: All required checks pass
Expand Down
58 changes: 32 additions & 26 deletions Doc/library/__future__.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,42 +22,48 @@
can be inspected programmatically via importing :mod:`__future__` and examining
its contents.

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

FeatureName = _Feature(OptionalRelease, MandatoryRelease,
CompilerFlag)
.. class:: _Feature

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

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

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

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

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

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

*MandatoryRelease* may also be ``None``, meaning that a planned feature got
dropped.
.. method:: _Feature.getMandatoryRelease()

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

*CompilerFlag* is the (bitfield) flag that should be passed in the fourth
argument to the built-in function :func:`compile` to enable the feature in
dynamically compiled code. This flag is stored in the :attr:`compiler_flag`
attribute on :class:`_Feature` instances.
Else *MandatoryRelease* records when the feature became part of the language; in
releases at or after that, modules no longer need a future statement to use the
feature in question, but may continue to use such imports.

*MandatoryRelease* may also be ``None``, meaning that a planned feature got
dropped or that it is not yet decided.

.. attribute:: _Feature.compiler_flag

*CompilerFlag* is the (bitfield) flag that should be passed in the fourth
argument to the built-in function :func:`compile` to enable the feature in
dynamically compiled code. This flag is stored in the :attr:`_Feature.compiler_flag`
attribute on :class:`_Feature` instances.

No feature description will ever be deleted from :mod:`__future__`. Since its
introduction in Python 2.1 the following features have found their way into the
Expand Down
14 changes: 9 additions & 5 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1381,15 +1381,19 @@ call fails (for example because the path doesn't exist).
>>> p.resolve()
PosixPath('/home/antoine/pathlib/setup.py')

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

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

.. versionchanged:: 3.13
Symlink loops are treated like other errors: :exc:`OSError` is raised in
strict mode, and no exception is raised in non-strict mode. In previous
versions, :exc:`RuntimeError` is raised no matter the value of *strict*.

.. method:: Path.rglob(pattern, *, case_sensitive=None, follow_symlinks=None)

Glob the given relative *pattern* recursively. This is like calling
Expand Down
6 changes: 6 additions & 0 deletions Doc/library/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,12 @@ Standard names are defined for the following types:

.. versionadded:: 3.12

.. class:: CapsuleType

The type of :ref:`capsule objects <capsules>`.

.. versionadded:: 3.13


Additional Utility Classes and Functions
----------------------------------------
Expand Down
19 changes: 9 additions & 10 deletions Doc/library/weakref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ See :ref:`__slots__ documentation <slots>` for details.

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

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

:class:`WeakValueDictionary` objects have an additional method that has the
same issues as the :meth:`keyrefs` method of :class:`WeakKeyDictionary`
objects.
same issues as the :meth:`WeakKeyDictionary.keyrefs` method.


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

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


Comparing finalizers with :meth:`__del__` methods
-------------------------------------------------
Comparing finalizers with :meth:`~object.__del__` methods
---------------------------------------------------------

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

* the object is garbage collected,
* the object's :meth:`remove` method is called, or
* the object's :meth:`!remove` method is called, or
* the program exits.

We might try to implement the class using a :meth:`__del__` method as
We might try to implement the class using a :meth:`~object.__del__` method as
follows::

class TempDir:
Expand All @@ -553,12 +552,12 @@ follows::
def __del__(self):
self.remove()

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

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

Expand Down
7 changes: 6 additions & 1 deletion Doc/library/xml.etree.elementtree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ for parsing and creating XML data.
This module will use a fast implementation whenever available.

.. deprecated:: 3.3
The :mod:`xml.etree.cElementTree` module is deprecated.
The :mod:`!xml.etree.cElementTree` module is deprecated.


.. warning::
Expand Down Expand Up @@ -825,6 +825,8 @@ Reference
Functions
^^^^^^^^^

.. module:: xml.etree.ElementInclude

.. function:: xml.etree.ElementInclude.default_loader( href, parse, encoding=None)
:module:

Expand Down Expand Up @@ -862,6 +864,9 @@ Functions
Element Objects
^^^^^^^^^^^^^^^

.. module:: xml.etree.ElementTree
:noindex:

.. class:: Element(tag, attrib={}, **extra)

Element class. This class defines the Element interface, and provides a
Expand Down
3 changes: 0 additions & 3 deletions Doc/tools/.nitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Doc/howto/enum.rst
Doc/howto/isolating-extensions.rst
Doc/howto/logging.rst
Doc/howto/urllib2.rst
Doc/library/__future__.rst
Doc/library/abc.rst
Doc/library/ast.rst
Doc/library/asyncio-dev.rst
Expand Down Expand Up @@ -134,12 +133,10 @@ Doc/library/unittest.mock.rst
Doc/library/unittest.rst
Doc/library/urllib.parse.rst
Doc/library/urllib.request.rst
Doc/library/weakref.rst
Doc/library/wsgiref.rst
Doc/library/xml.dom.minidom.rst
Doc/library/xml.dom.pulldom.rst
Doc/library/xml.dom.rst
Doc/library/xml.etree.elementtree.rst
Doc/library/xml.rst
Doc/library/xml.sax.handler.rst
Doc/library/xml.sax.reader.rst
Expand Down
15 changes: 12 additions & 3 deletions Doc/using/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -964,9 +964,18 @@ Main Makefile targets
You can use the configure :option:`--enable-optimizations` option to make
this the default target of the ``make`` command (``make all`` or just
``make``).
* ``make buildbottest``: Build Python and run the Python test suite, the same
way than buildbots test Python. Set ``TESTTIMEOUT`` variable (in seconds)
to change the test timeout (1200 by default: 20 minutes).

* ``make test``: Build Python and run the Python test suite with ``--fast-ci``
option. Variables:

* ``TESTOPTS``: additional regrtest command line options.
* ``TESTPYTHONOPTS``: additional Python command line options.
* ``TESTTIMEOUT``: timeout in seconds (default: 20 minutes).

* ``make buildbottest``: Similar to ``make test``, but use ``--slow-ci``
option and default timeout of 20 minutes, instead of ``--fast-ci`` option
and a default timeout of 10 minutes.

* ``make install``: Build and install Python.
* ``make regen-all``: Regenerate (almost) all generated files;
``make regen-stdlib-module-names`` and ``autoconf`` must be run separately
Expand Down
Loading

0 comments on commit 5aae7a2

Please sign in to comment.