Skip to content

Commit eb7066e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pr-145149
# Conflicts: # Modules/clinic/_asynciomodule.c.h
2 parents 2e18c6b + 233b95c commit eb7066e

191 files changed

Lines changed: 3972 additions & 1231 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: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,12 @@ jobs:
167167
- true
168168
interpreter:
169169
- switch-case
170+
- tail-call
170171
exclude:
171172
# Skip Win32 on free-threaded builds
172173
- { arch: Win32, free-threading: true }
173-
include:
174-
# msvc::musttail is currently only supported on x64,
175-
# and only supported on 3.15+.
176-
- { arch: x64, free-threading: false, interpreter: tail-call }
177-
- { arch: x64, free-threading: true, interpreter: tail-call }
174+
# Skip Win32 on tail-call interpreter builds
175+
- { arch: Win32, interpreter: tail-call }
178176
uses: $/.github/workflows/reusable-windows.yml
179177
with:
180178
arch: ${{ matrix.arch }}
@@ -549,9 +547,17 @@ jobs:
549547
run: |
550548
"$BUILD_DIR/host-python/bin/python3" -m test test_sysconfig test_site test_embed
551549
- name: Configure cross build
552-
run: ./configure --prefix="$BUILD_DIR/cross-python" --with-build-python="$BUILD_DIR/host-python/bin/python3"
550+
run: |
551+
# Exercise a native build whose builtin modules differ from the build Python.
552+
echo '_bisect _bisectmodule.c' > Modules/Setup.local
553+
./configure --prefix="$BUILD_DIR/cross-python" --with-build-python="$BUILD_DIR/host-python/bin/python3"
553554
- name: Install cross Python
554555
run: make -j8 install
556+
- name: Check native extension modules with a build Python
557+
run: |
558+
"$BUILD_DIR/host-python/bin/python3" -c "import sys; assert '_bisect' not in sys.builtin_module_names"
559+
"$BUILD_DIR/cross-python/bin/python3" -c "import _bisect, sys; assert '_bisect' in sys.builtin_module_names"
560+
PYTHONSTRICTEXTENSIONBUILD=1 make checksharedmods
555561
- name: Display build info
556562
run: |
557563
"$BUILD_DIR/cross-python/bin/python3" -m test.pythoninfo

‎Doc/library/curses.rst‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,10 +1032,15 @@ Terminfo database
10321032
Instantiate the bytes object *str* with the supplied parameters, where *str* should
10331033
be a parameterized byte string obtained from the terminfo database. For example,
10341034
``tparm(tigetstr("cup"), 5, 3)`` could result in ``b'\033[6;4H'``, the exact
1035-
result depending on terminal type. Up to nine integer parameters may be supplied.
1035+
result depending on terminal type. Up to nine parameters may be supplied.
1036+
They are integers, except in a few cases, such as ``Ms`` of xterm,
1037+
where they must be bytes objects.
10361038

10371039
:func:`setupterm` (or :func:`initscr`) must be called first.
10381040

1041+
.. versionchanged:: next
1042+
Added support of bytes parameters.
1043+
10391044
.. function:: putp(str)
10401045

10411046
Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified

‎Doc/library/platform.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ Android platform
325325

326326
* ``release`` - Android version, as a string (e.g. ``"14"``).
327327

328-
* ``api_level`` - API level of the running device, as an integer (e.g. ``34``
328+
* ``api_level`` - Major component of the API level, as an integer (e.g. ``34``
329329
for Android 14). To get the API level which Python was built against, see
330330
:func:`sys.getandroidapilevel`.
331331

‎Doc/library/runpy.rst‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,9 @@ The :mod:`!runpy` module provides two functions:
114114
For a simple script, the specified code is simply executed in a fresh
115115
module namespace. For a valid :data:`sys.path` entry (typically a zipfile or
116116
directory), the entry is first added to the beginning of ``sys.path``. The
117-
function then looks for and executes a :mod:`__main__` module using the
118-
updated path. Note that there is no special protection against invoking
119-
an existing ``__main__`` entry located elsewhere on ``sys.path`` if
120-
there is no such module at the specified location.
117+
function then looks for and executes a :mod:`__main__` module in that
118+
entry. :exc:`ImportError` is raised if there is no such module at the
119+
specified location.
121120

122121
The optional dictionary argument *init_globals* may be used to pre-populate
123122
the module's globals dictionary before the code is executed.
@@ -177,6 +176,9 @@ The :mod:`!runpy` module provides two functions:
177176
.. versionchanged:: 3.15
178177
The global variable ``__cached__`` is no longer set.
179178

179+
.. versionchanged:: next
180+
The ``__main__`` module is now searched only in *path_name*.
181+
180182
.. seealso::
181183

182184
:pep:`338` -- Executing modules as scripts

‎Doc/library/ssl.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,10 +2100,10 @@ to speed up repeated connections from the same clients.
21002100

21012101
NPN has been superseded by ALPN
21022102

2103-
.. method:: SSLContext.set_outer_alpn_protocols(protocols)
2103+
.. method:: SSLContext.set_outer_alpn_protocols(alpn_protocols)
21042104

21052105
Specify which protocols the socket should advertise during the TLS
2106-
handshake in the outer ClientHello when ECH is used. The *protocols*
2106+
handshake in the outer ClientHello when ECH is used. The *alpn_protocols*
21072107
argument accepts the same values as for
21082108
:meth:`~SSLContext.set_alpn_protocols`.
21092109

‎Doc/library/subprocess.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ calls these functions.
13261326
... "ls non_existent_file; exit 0",
13271327
... stderr=subprocess.STDOUT,
13281328
... shell=True)
1329-
'ls: non_existent_file: No such file or directory\n'
1329+
b'ls: non_existent_file: No such file or directory\n'
13301330

13311331
.. versionadded:: 3.1
13321332

‎Doc/library/sys.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -862,9 +862,9 @@ always available. Unless explicitly noted otherwise, all variables are read-only
862862

863863
.. function:: getandroidapilevel()
864864

865-
Return the build-time API level of Android as an integer. This represents the
866-
minimum version of Android this build of Python can run on. For runtime
867-
version information, see :func:`platform.android_ver`.
865+
Return the major component of the Android API level that Python was built
866+
against, as an integer. For runtime version information, see
867+
:func:`platform.android_ver`.
868868

869869
.. availability:: Android.
870870

‎Doc/library/test.rst‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,8 @@ The :mod:`!test.support` module defines the following functions:
517517
``True`` if called by a function whose ``__name__`` is ``'__main__'``.
518518
Used when tests are executed by :mod:`test.regrtest`.
519519

520+
If called at the top level, sets label "requires\_\ *resource*" on the module.
521+
520522

521523
.. function:: sortdict(dict)
522524

@@ -533,6 +535,29 @@ The :mod:`!test.support` module defines the following functions:
533535
rather than looking directly in the path directories.
534536

535537

538+
.. function:: mark(label, value=True, /)
539+
540+
Add a label to a test. Use ``@mark('label')`` as a decorator of a test
541+
method or class.
542+
543+
The optional *value* (``True`` by default) is matched on the command line
544+
by ``--label label=value``, whereas ``--label label`` matches any value.
545+
546+
Many :mod:`test.support` decorators like :func:`requires_resource`,
547+
:func:`~test.support.cpython_only` or :func:`bigmemtest` add labels
548+
automatically.
549+
550+
551+
.. function:: mark_module(label, value=True, /, *, globals=None)
552+
553+
Add a label to every test of a module. Call it at the module level::
554+
555+
test.support.mark_module('pickletest')
556+
557+
The module is the caller, unless its :func:`globals` dict is passed as the
558+
*globals* argument.
559+
560+
536561
.. function:: get_pagesize()
537562

538563
Get size of a page in bytes.
@@ -777,26 +802,31 @@ The :mod:`!test.support` module defines the following functions:
777802
.. decorator:: requires_zlib
778803

779804
Decorator for skipping tests if :mod:`zlib` doesn't exist.
805+
Adds label "requires_zlib".
780806

781807

782808
.. decorator:: requires_gzip
783809

784810
Decorator for skipping tests if :mod:`gzip` doesn't exist.
811+
Adds label "requires_gzip".
785812

786813

787814
.. decorator:: requires_bz2
788815

789816
Decorator for skipping tests if :mod:`bz2` doesn't exist.
817+
Adds label "requires_bz2".
790818

791819

792820
.. decorator:: requires_lzma
793821

794822
Decorator for skipping tests if :mod:`lzma` doesn't exist.
823+
Adds label "requires_lzma".
795824

796825

797826
.. decorator:: requires_resource(resource)
798827

799828
Decorator for skipping tests if *resource* is not available.
829+
Adds label "requires\_\ *resource*".
800830

801831

802832
.. decorator:: requires_docstrings
@@ -813,12 +843,17 @@ The :mod:`!test.support` module defines the following functions:
813843
.. decorator:: cpython_only
814844

815845
Decorator for tests only applicable to CPython.
846+
Adds label "impl_detail_cpython".
816847

817848

818849
.. decorator:: impl_detail(msg=None, **guards)
819850

820851
Decorator for invoking :func:`check_impl_detail` on *guards*. If that
821852
returns ``False``, then uses *msg* as the reason for skipping the test.
853+
For every keyword argument *name* adds a label
854+
"impl_detail\_\ *name*" if its value is true or
855+
"impl_detail_no\_\ *name*" otherwise.
856+
822857

823858
.. decorator:: thread_unsafe(reason=None)
824859

@@ -853,10 +888,13 @@ The :mod:`!test.support` module defines the following functions:
853888
method may be less than the requested value. If *dry_run* is ``False``, it
854889
means the test doesn't support dummy runs when ``-M`` is not specified.
855890

891+
Adds label "bigmemtest".
892+
856893

857894
.. decorator:: bigaddrspacetest
858895

859896
Decorator for tests that fill the address space.
897+
Adds label "bigaddrspacetest".
860898

861899

862900
.. function:: linked_to_musl()
@@ -1800,6 +1838,8 @@ Importing modules
18001838
optional for others, set *required_on* to an iterable of platform prefixes
18011839
which will be compared against :data:`sys.platform`.
18021840

1841+
If called at the top level, sets label "requires\_\ *name*" on the module.
1842+
18031843
.. versionadded:: 3.1
18041844

18051845
.. function:: import_fresh_module(name, fresh=(), blocked=(), *, deprecated=False, usefrozen=False)

0 commit comments

Comments
 (0)