Skip to content

Commit 853d372

Browse files
Merge branch 'main' into fix-forkserver-sigkill-race
2 parents b6ae309 + fd657b0 commit 853d372

120 files changed

Lines changed: 2885 additions & 1047 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/reusable-emscripten.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,5 @@ jobs:
7979
run: python3 Platforms/emscripten run --test
8080
- name: "Test Repl"
8181
run: Platforms/emscripten/browser_test/run_test.sh
82+
- name: "Test embedding"
83+
run: Platforms/emscripten/web_embed_test/run_test.sh

‎.github/workflows/reusable-wasi.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ jobs:
1616
timeout-minutes: 60
1717
env:
1818
WASMTIME_VERSION: 48.0.2
19-
CROSS_BUILD_WASI: cross-build/wasm32-wasip1
2019
steps:
2120
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2221
with:
@@ -65,4 +64,6 @@ jobs:
6564
- name: "Display build info of the host/WASI Python"
6665
run: python3 Platforms/WASI pythoninfo-host
6766
- name: "Test"
68-
run: make --directory "${CROSS_BUILD_WASI}" test
67+
run: |
68+
CROSS_BUILD_WASI=$(python3 Platforms/WASI path)
69+
make --directory "${CROSS_BUILD_WASI}" test

‎Doc/README.rst‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ tree but are maintained separately and are available from
2121
* `Sphinx <https://pypi.org/project/Sphinx/>`_
2222
* `blurb <https://pypi.org/project/blurb/>`_
2323
* `python-docs-theme <https://pypi.org/project/python-docs-theme/>`_
24+
* `sphinx-linklint <https://pypi.org/project/sphinx-linklint/>`_
2425

2526
The easiest way to install these tools is to create a virtual environment and
2627
install the tools into there.
@@ -57,6 +58,8 @@ Available make targets are:
5758
* "venv", which creates a virtual environment with all necessary tools
5859
installed.
5960

61+
* "lock", which regenerates the pinned dependencies in ``pylock.toml``.
62+
6063
* "html", which builds standalone HTML files for offline viewing.
6164

6265
* "htmlview", which re-uses the "html" builder, but then opens the main page
@@ -79,6 +82,9 @@ Available make targets are:
7982

8083
* "text", which builds a plain text file for each source file.
8184

85+
* "texinfo", which builds Texinfo source files as input to ``makeinfo`` to
86+
produce Info documents.
87+
8288
* "epub", which builds an EPUB document, suitable to be viewed on e-book
8389
readers.
8490

@@ -97,6 +103,10 @@ Available make targets are:
97103
plain text documentation for the labels defined in
98104
``tools/pyspecific.py`` -- pydoc needs these to show topic and keyword help.
99105

106+
* "doctest", which runs doctests in the documentation.
107+
108+
* "gettext", which generates gettext message catalog templates.
109+
100110
* "check", which checks for frequent markup errors.
101111

102112
* "dist", (Unix only) which creates distributable archives of HTML, text,

‎Doc/library/ctypes.rst‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,31 @@ write::
13371337
:class:`threading.local` will *not* survive across different callbacks, even when
13381338
those calls are made from the same C thread.
13391339

1340+
Callback functions can return structures and unions by value, in addition to
1341+
the simple types:
1342+
1343+
.. code-block:: python
1344+
1345+
class Point(Structure):
1346+
_fields_ = [("x", c_int), ("y", c_int)]
1347+
1348+
@CFUNCTYPE(Point)
1349+
def get_origin():
1350+
return Point(0, 0)
1351+
1352+
.. note::
1353+
1354+
A structure or union returned from a callback is copied *by value*, and
1355+
:mod:`!ctypes` does not keep the returned object alive after the callback
1356+
returns. If the structure contains a pointer field (such as
1357+
:class:`c_char_p` or a :func:`POINTER` type), you must ensure that the
1358+
memory it refers to stays valid for as long as the C code uses it -- the
1359+
same requirement C itself imposes. Returning a pointer to memory owned by
1360+
a temporary Python object will leave the C caller with a dangling pointer.
1361+
1362+
.. versionchanged:: next
1363+
Callback functions can now return structures and unions.
1364+
13401365
.. _ctypes-accessing-values-exported-from-dlls:
13411366

13421367
Accessing values exported from dlls

‎Doc/library/dis.rst‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,10 +1436,14 @@ iterations of the loop.
14361436
.. opcode:: LOAD_GLOBAL (namei)
14371437

14381438
Loads the global named ``co_names[namei>>1]`` onto the stack.
1439+
If the low bit of ``namei`` is set, a ``NULL`` is pushed onto the stack
1440+
after the global variable.
14391441

14401442
.. versionchanged:: 3.11
1441-
If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the
1442-
stack before the global variable.
1443+
The low bit of ``namei`` indicates whether a ``NULL`` is pushed.
1444+
1445+
.. versionchanged:: 3.13
1446+
The ``NULL`` is pushed after the global variable, rather than before it.
14431447

14441448
.. opcode:: LOAD_FAST (var_num)
14451449

‎Doc/library/shutil.rst‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ Directory and files operations
242242

243243
.. function:: copytree(src, dst, symlinks=False, ignore=None, \
244244
copy_function=copy2, ignore_dangling_symlinks=False, \
245-
dirs_exist_ok=False)
245+
dirs_exist_ok=False, *, copy_dir_stat=True)
246246
247247
Recursively copy an entire directory tree rooted at *src* to a directory
248248
named *dst* and return the destination directory. All intermediate
@@ -251,6 +251,12 @@ Directory and files operations
251251
Permissions and times of directories are copied with :func:`copystat`,
252252
individual files are copied using :func:`~shutil.copy2`.
253253

254+
If *copy_dir_stat* is false, directory metadata is not copied with
255+
:func:`copystat`, e.g. to copy a read-only tree into a writable one.
256+
It defaults to true. Note that file metadata is always handled by
257+
*copy_function*: use e.g. ``copy_function=shutil.copyfile`` to skip
258+
that as well.
259+
254260
If *symlinks* is true, symbolic links in the source tree are represented as
255261
symbolic links in the new tree and the metadata of the original links will
256262
be copied as far as the platform allows; if false or omitted, the contents
@@ -306,6 +312,9 @@ Directory and files operations
306312
.. versionchanged:: 3.8
307313
Added the *dirs_exist_ok* parameter.
308314

315+
.. versionchanged:: 3.16
316+
Added the *copy_dir_stat* parameter.
317+
309318
.. function:: rmtree(path, ignore_errors=False, onerror=None, *, onexc=None, dir_fd=None)
310319

311320
.. index:: single: directory; deleting
@@ -316,6 +325,12 @@ Directory and files operations
316325
handled by calling a handler specified by *onexc* or *onerror* or, if both
317326
are omitted, exceptions are propagated to the caller.
318327

328+
If *path* is a symbolic link to a directory followed by a trailing path
329+
separator, such as ``'link/'``, the operating system resolves the link, so
330+
:func:`!rmtree` deletes the contents of the directory it points to and then
331+
fails to remove *path* itself. :class:`pathlib.Path` strips trailing
332+
separators, so ``rmtree(Path('link/'))`` refuses the link as usual.
333+
319334
This function can support :ref:`paths relative to directory descriptors
320335
<dir_fd>`.
321336

‎Doc/library/tarfile.rst‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,11 @@ reused in custom filters:
11311131
- :ref:`Refuse <tarfile-extraction-refuse>` to extract files whose absolute
11321132
path (after following symlinks) would end up outside the destination.
11331133
This raises :class:`~tarfile.OutsideDestinationError`.
1134+
- :ref:`Refuse <tarfile-extraction-refuse>` to extract links (hard or soft)
1135+
whose name refers to the destination directory itself.
1136+
This raises :class:`~tarfile.OutsideDestinationError`.
1137+
Note that such files are refused even on platforms that do not support
1138+
symbolic links.
11341139
- Clear high mode bits (setuid, setgid, sticky) and group/other write bits
11351140
(:const:`~stat.S_IWGRP` | :const:`~stat.S_IWOTH`).
11361141

‎Doc/library/zipfile.rst‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,10 @@ Path objects are traversable using the ``/`` operator or ``joinpath``.
722722

723723
Enumerate the children of the current directory.
724724

725+
.. versionchanged:: 3.16
726+
Raises :exc:`NotADirectoryError` when the current context does not
727+
reference a directory. Previously, it raised :exc:`ValueError`.
728+
725729
.. method:: Path.is_dir()
726730

727731
Return ``True`` if the current context references a directory.

‎Doc/using/configure.rst‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,24 @@ also be used to improve performance.
763763
BOLT versions before LLVM 16 are known to crash BOLT under some scenarios.
764764
Use of LLVM 16 or newer for BOLT optimization is strongly encouraged.
765765

766+
BOLT does not preserve protection against Cortex-A53 erratum 843419. Binaries
767+
processed by BOLT must not run on processors affected by this erratum,
768+
including during the build. On AArch64, :program:`configure` reports an error
769+
if build flags explicitly request the workaround. Recent BOLT versions reject
770+
workaround veneers by default during the build, including when the workaround
771+
is enabled by compiler defaults.
772+
773+
If none of the generated executables or shared libraries will run on affected
774+
processors, disable the workaround explicitly. For GCC toolchains that enable
775+
it by default, pass ``-mno-fix-cortex-a53-843419`` through
776+
:envvar:`LDFLAGS_NODIST`::
777+
778+
LDFLAGS_NODIST="-mno-fix-cortex-a53-843419" ./configure --enable-bolt
779+
780+
Remove any explicit ``-mfix-cortex-a53-843419`` or
781+
``-Wl,--fix-cortex-a53-843419`` flags from the build configuration. The GCC
782+
option does not override explicit linker flags.
783+
766784
The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!BOLT_APPLY_FLAGS`
767785
:program:`configure` variables can be defined to override the default set of
768786
arguments for :program:`llvm-bolt` to instrument and apply BOLT data to

‎Doc/using/windows.rst‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,27 @@ New runtime versions may be added using ``py install``. One or more tags may be
272272
specified, and the special tag ``default`` may be used to select the default.
273273
Ranges are not supported for installation.
274274

275+
CPython publishes multiple runtime variants. For most users,
276+
``PythonCore`` is recommended and provides the standard CPython runtime.
277+
Tags without any prefix are treated as ``PythonCore\<TAG>``.
278+
279+
``PythonTest`` includes the standard runtime together with the test suite
280+
and debugging symbols. It is intended for contributors or users who need
281+
these additional files for testing or debugging Python.
282+
283+
``PythonEmbed`` provides a minimal embeddable distribution for
284+
applications that bundle Python rather than for interactive use. It
285+
would normally be used with the ``--target`` option described below.
286+
287+
To see the available runtime variants, run::
288+
289+
py list --online
290+
291+
To install a specific variant, include it in the tag passed to
292+
``py install``::
293+
294+
py install PythonTest\3.14
295+
275296
The ``--source=<URL>`` option allows overriding the online index that is used to
276297
obtain runtimes. This may be used with an offline index, as shown in
277298
:ref:`pymanager-offline`.

0 commit comments

Comments
 (0)