Skip to content

Commit 507266e

Browse files
Merge branch 'main' into ssl-bugfix-116810
2 parents 8fff948 + 033d537 commit 507266e

Some content is hidden

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

55 files changed

+2403
-821
lines changed

Doc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ dist:
217217
# as otherwise the full latexmk process is run twice.
218218
# ($$ is needed to escape the $; https://www.gnu.org/software/make/manual/make.html#Basics-of-Variable-References)
219219
-sed -i 's/: all-$$(FMT)/:/' build/latex/Makefile
220-
(cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$((`nproc`+1)) --output-sync LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
220+
(cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$$((`nproc`+1)) --output-sync LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
221221
cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-a4.zip
222222
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-a4.tar.bz2
223223
@echo "Build finished and archived!"
@@ -227,7 +227,7 @@ dist:
227227
rm -rf build/latex
228228
$(MAKE) latex PAPER=letter
229229
-sed -i 's/: all-$$(FMT)/:/' build/latex/Makefile
230-
(cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$((`nproc`+1)) --output-sync LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
230+
(cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$$((`nproc`+1)) --output-sync LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
231231
cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip
232232
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2
233233
@echo "Build finished and archived!"

Doc/deprecations/pending-removal-in-3.16.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ Pending Removal in Python 3.16
55
:class:`array.array` ``'u'`` type (:c:type:`wchar_t`):
66
use the ``'w'`` type instead (``Py_UCS4``).
77

8+
* :mod:`builtins`:
9+
``~bool``, bitwise inversion on bool.
10+
811
* :mod:`symtable`:
912
Deprecate :meth:`symtable.Class.get_methods` due to the lack of interest.
1013
(Contributed by Bénédikt Tran in :gh:`119698`.)

Doc/deprecations/pending-removal-in-future.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ although there is currently no date scheduled for their removal.
1111

1212
* :mod:`builtins`:
1313

14-
* ``~bool``, bitwise inversion on bool.
1514
* ``bool(NotImplemented)``.
1615
* Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)``
1716
signature is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead,

Doc/library/os.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3892,6 +3892,8 @@ features:
38923892
.. versionadded:: 3.10
38933893

38943894

3895+
.. _os-timerfd:
3896+
38953897
Timer File Descriptors
38963898
~~~~~~~~~~~~~~~~~~~~~~
38973899

Doc/library/pathlib.rst

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,8 +1536,8 @@ Creating files and directories
15361536
available. In previous versions, :exc:`NotImplementedError` was raised.
15371537

15381538

1539-
Copying, renaming and deleting
1540-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1539+
Copying, moving and deleting
1540+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15411541

15421542
.. method:: Path.copy(target, *, follow_symlinks=True, dirs_exist_ok=False, \
15431543
preserve_metadata=False, ignore=None, on_error=None)
@@ -1575,6 +1575,18 @@ Copying, renaming and deleting
15751575
.. versionadded:: 3.14
15761576

15771577

1578+
.. method:: Path.copy_into(target_dir, *, follow_symlinks=True, \
1579+
dirs_exist_ok=False, preserve_metadata=False, \
1580+
ignore=None, on_error=None)
1581+
1582+
Copy this file or directory tree into the given *target_dir*, which should
1583+
be an existing directory. Other arguments are handled identically to
1584+
:meth:`Path.copy`. Returns a new :class:`!Path` instance pointing to the
1585+
copy.
1586+
1587+
.. versionadded:: 3.14
1588+
1589+
15781590
.. method:: Path.rename(target)
15791591

15801592
Rename this file or directory to the given *target*, and return a new
@@ -1616,59 +1628,50 @@ Copying, renaming and deleting
16161628
Added return value, return the new :class:`!Path` instance.
16171629

16181630

1619-
.. method:: Path.unlink(missing_ok=False)
1631+
.. method:: Path.move(target)
16201632

1621-
Remove this file or symbolic link. If the path points to a directory,
1622-
use :func:`Path.rmdir` or :func:`Path.delete` instead.
1633+
Move this file or directory tree to the given *target*, and return a new
1634+
:class:`!Path` instance pointing to *target*.
16231635

1624-
If *missing_ok* is false (the default), :exc:`FileNotFoundError` is
1625-
raised if the path does not exist.
1636+
If the *target* doesn't exist it will be created. If both this path and the
1637+
*target* are existing files, then the target is overwritten. If both paths
1638+
point to the same file or directory, or the *target* is a non-empty
1639+
directory, then :exc:`OSError` is raised.
16261640

1627-
If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be
1628-
ignored (same behavior as the POSIX ``rm -f`` command).
1641+
If both paths are on the same filesystem, the move is performed with
1642+
:func:`os.replace`. Otherwise, this path is copied (preserving metadata and
1643+
symlinks) and then deleted.
16291644

1630-
.. versionchanged:: 3.8
1631-
The *missing_ok* parameter was added.
1645+
.. versionadded:: 3.14
16321646

16331647

1634-
.. method:: Path.rmdir()
1648+
.. method:: Path.move_into(target_dir)
16351649

1636-
Remove this directory. The directory must be empty; use
1637-
:meth:`Path.delete` to remove a non-empty directory.
1650+
Move this file or directory tree into the given *target_dir*, which should
1651+
be an existing directory. Returns a new :class:`!Path` instance pointing to
1652+
the moved path.
16381653

1654+
.. versionadded:: 3.14
16391655

1640-
.. method:: Path.delete(ignore_errors=False, on_error=None)
16411656

1642-
Delete this file or directory. If this path refers to a non-empty
1643-
directory, its files and sub-directories are deleted recursively.
1657+
.. method:: Path.unlink(missing_ok=False)
16441658

1645-
If *ignore_errors* is true, errors resulting from failed deletions will be
1646-
ignored. If *ignore_errors* is false or omitted, and a callable is given as
1647-
the optional *on_error* argument, it will be called with one argument of
1648-
type :exc:`OSError` each time an exception is raised. The callable can
1649-
handle the error to continue the deletion process or re-raise it to stop.
1650-
Note that the filename is available as the :attr:`~OSError.filename`
1651-
attribute of the exception object. If neither *ignore_errors* nor
1652-
*on_error* are supplied, exceptions are propagated to the caller.
1659+
Remove this file or symbolic link. If the path points to a directory,
1660+
use :func:`Path.rmdir` instead.
16531661

1654-
.. note::
1662+
If *missing_ok* is false (the default), :exc:`FileNotFoundError` is
1663+
raised if the path does not exist.
16551664

1656-
When deleting non-empty directories on platforms that lack the necessary
1657-
file descriptor-based functions, the :meth:`~Path.delete` implementation
1658-
is susceptible to a symlink attack: given proper timing and
1659-
circumstances, attackers can manipulate symlinks on the filesystem to
1660-
delete files they would not be able to access otherwise. Applications
1661-
can use the :data:`~Path.delete.avoids_symlink_attacks` method attribute
1662-
to determine whether the implementation is immune to this attack.
1665+
If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be
1666+
ignored (same behavior as the POSIX ``rm -f`` command).
16631667

1664-
.. attribute:: delete.avoids_symlink_attacks
1668+
.. versionchanged:: 3.8
1669+
The *missing_ok* parameter was added.
16651670

1666-
Indicates whether the current platform and implementation provides a
1667-
symlink attack resistant version of :meth:`~Path.delete`. Currently
1668-
this is only true for platforms supporting fd-based directory access
1669-
functions.
16701671

1671-
.. versionadded:: 3.14
1672+
.. method:: Path.rmdir()
1673+
1674+
Remove this directory. The directory must be empty.
16721675

16731676

16741677
Permissions and ownership

Doc/library/stdtypes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ over ``&``, ``|`` and ``^``.
868868
.. deprecated:: 3.12
869869

870870
The use of the bitwise inversion operator ``~`` is deprecated and will
871-
raise an error in Python 3.14.
871+
raise an error in Python 3.16.
872872

873873
:class:`bool` is a subclass of :class:`int` (see :ref:`typesnumeric`). In
874874
many numeric contexts, ``False`` and ``True`` behave like the integers 0 and 1, respectively.

Doc/library/traceback.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ The module defines the following functions:
4242
:term:`file <file object>` or :term:`file-like object` to
4343
receive the output.
4444

45+
.. note::
46+
47+
The meaning of the *limit* parameter is different than the meaning
48+
of :const:`sys.tracebacklimit`. A negative *limit* value corresponds to
49+
a positive value of :const:`!sys.tracebacklimit`, whereas the behaviour of
50+
a positive *limit* value cannot be achieved with
51+
:const:`!sys.tracebacklimit`.
52+
4553
.. versionchanged:: 3.5
4654
Added negative *limit* support.
4755

Doc/whatsnew/3.12.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ Deprecated
13191319
(Contributed by Brett Cannon in :gh:`65961`.)
13201320

13211321
* The bitwise inversion operator (``~``) on bool is deprecated. It will throw an
1322-
error in Python 3.14. Use ``not`` for logical negation of bools instead.
1322+
error in Python 3.16. Use ``not`` for logical negation of bools instead.
13231323
In the rare case that you really need the bitwise inversion of the underlying
13241324
``int``, convert to int explicitly: ``~int(x)``. (Contributed by Tim Hoffmann
13251325
in :gh:`103487`.)

0 commit comments

Comments
 (0)