Skip to content

Commit 3e6c3ca

Browse files
Merge branch '3.14' into backport-fd6b639-3.14
2 parents 7725c61 + d148662 commit 3e6c3ca

83 files changed

Lines changed: 1354 additions & 501 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ jobs:
303303
# Keep 1.1.1w in our list despite it being upstream EOL and otherwise
304304
# unsupported as it most resembles other 1.1.1-work-a-like ssl APIs
305305
# supported by important vendors such as AWS-LC.
306-
openssl_ver: [1.1.1w, 3.0.18, 3.2.6, 3.3.5, 3.4.3, 3.5.4]
306+
openssl_ver: [1.1.1w, 3.0.19, 3.3.6, 3.4.4, 3.5.5, 3.6.1]
307307
# See Tools/ssl/make_ssl_data.py for notes on adding a new version
308308
env:
309309
OPENSSL_VER: ${{ matrix.openssl_ver }}

.github/workflows/tail-call.yml

Lines changed: 71 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
name: Tail calling interpreter
22
on:
33
pull_request:
4-
paths:
4+
paths: &paths
55
- '.github/workflows/tail-call.yml'
66
- 'Python/bytecodes.c'
77
- 'Python/ceval.c'
88
- 'Python/ceval_macros.h'
99
- 'Python/generated_cases.c.h'
1010
push:
11-
paths:
12-
- '.github/workflows/tail-call.yml'
13-
- 'Python/bytecodes.c'
14-
- 'Python/ceval.c'
15-
- 'Python/ceval_macros.h'
16-
- 'Python/generated_cases.c.h'
11+
paths: *paths
1712
workflow_dispatch:
1813

1914
permissions:
@@ -25,108 +20,107 @@ concurrency:
2520

2621
env:
2722
FORCE_COLOR: 1
23+
LLVM_VERSION: 20
2824

2925
jobs:
30-
tail-call:
26+
windows:
3127
name: ${{ matrix.target }}
3228
runs-on: ${{ matrix.runner }}
33-
timeout-minutes: 90
29+
timeout-minutes: 60
3430
strategy:
3531
fail-fast: false
3632
matrix:
37-
target:
38-
# Un-comment as we add support for more platforms for tail-calling interpreters.
39-
# - i686-pc-windows-msvc/msvc
40-
- x86_64-pc-windows-msvc/msvc
41-
# - aarch64-pc-windows-msvc/msvc
42-
- x86_64-apple-darwin/clang
43-
- aarch64-apple-darwin/clang
44-
- x86_64-unknown-linux-gnu/gcc
45-
- aarch64-unknown-linux-gnu/gcc
46-
- free-threading
47-
llvm:
48-
- 20
4933
include:
50-
# - target: i686-pc-windows-msvc/msvc
51-
# architecture: Win32
52-
# runner: windows-2022
5334
- target: x86_64-pc-windows-msvc/msvc
5435
architecture: x64
5536
runner: windows-2022
56-
# - target: aarch64-pc-windows-msvc/msvc
57-
# architecture: ARM64
58-
# runner: windows-2022
59-
- target: x86_64-apple-darwin/clang
60-
architecture: x86_64
61-
runner: macos-15-intel
62-
- target: aarch64-apple-darwin/clang
63-
architecture: aarch64
64-
runner: macos-14
65-
- target: x86_64-unknown-linux-gnu/gcc
66-
architecture: x86_64
67-
runner: ubuntu-24.04
68-
- target: aarch64-unknown-linux-gnu/gcc
69-
architecture: aarch64
70-
runner: ubuntu-24.04-arm
71-
- target: free-threading
72-
architecture: x86_64
73-
runner: ubuntu-24.04
37+
build_flags: ""
38+
run_tests: true
7439
steps:
7540
- uses: actions/checkout@v6
7641
with:
7742
persist-credentials: false
7843
- uses: actions/setup-python@v6
7944
with:
8045
python-version: '3.11'
81-
82-
- name: Native Windows (debug)
83-
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
46+
- name: Build
8447
shell: pwsh
8548
run: |
86-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
49+
choco install llvm --allow-downgrade --no-progress --version ${{ env.LLVM_VERSION }}.1.0
8750
$env:PlatformToolset = "clangcl"
88-
$env:LLVMToolsVersion = "${{ matrix.llvm }}.1.0"
51+
$env:LLVMToolsVersion = "${{ env.LLVM_VERSION }}.1.0"
8952
$env:LLVMInstallDir = "C:\Program Files\LLVM"
90-
./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
91-
./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
92-
93-
# No tests (yet):
94-
- name: Emulated Windows (release)
95-
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
53+
./PCbuild/build.bat --tail-call-interp ${{ matrix.build_flags }} -c Release -p ${{ matrix.architecture }}
54+
- name: Test
55+
if: matrix.run_tests
9656
shell: pwsh
9757
run: |
98-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
99-
$env:PlatformToolset = "clangcl"
100-
$env:LLVMToolsVersion = "${{ matrix.llvm }}.1.0"
101-
$env:LLVMInstallDir = "C:\Program Files\LLVM"
102-
./PCbuild/build.bat --tail-call-interp -p ${{ matrix.architecture }}
58+
./PCbuild/rt.bat -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
10359
104-
- name: Native macOS (release)
105-
if: runner.os == 'macOS'
60+
macos:
61+
name: ${{ matrix.target }}
62+
runs-on: ${{ matrix.runner }}
63+
timeout-minutes: 60
64+
strategy:
65+
fail-fast: false
66+
matrix:
67+
include:
68+
- target: x86_64-apple-darwin/clang
69+
runner: macos-15-intel
70+
- target: aarch64-apple-darwin/clang
71+
runner: macos-14
72+
steps:
73+
- uses: actions/checkout@v6
74+
with:
75+
persist-credentials: false
76+
- uses: actions/setup-python@v6
77+
with:
78+
python-version: '3.11'
79+
- name: Install dependencies
10680
run: |
10781
brew update
108-
brew install llvm@${{ matrix.llvm }}
82+
brew install llvm@${{ env.LLVM_VERSION }}
83+
- name: Build
84+
run: |
10985
export SDKROOT="$(xcrun --show-sdk-path)"
110-
export PATH="/usr/local/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
111-
export PATH="/opt/homebrew/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
112-
CC=clang-20 ./configure --with-tail-call-interp
86+
export PATH="/usr/local/opt/llvm@${{ env.LLVM_VERSION }}/bin:$PATH"
87+
export PATH="/opt/homebrew/opt/llvm@${{ env.LLVM_VERSION }}/bin:$PATH"
88+
CC=clang-${{ env.LLVM_VERSION }} ./configure --with-tail-call-interp
11389
make all --jobs 4
90+
- name: Test
91+
run: |
11492
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
11593
116-
- name: Native Linux (debug)
117-
if: runner.os == 'Linux' && matrix.target != 'free-threading'
94+
linux:
95+
name: ${{ matrix.target }}
96+
runs-on: ${{ matrix.runner }}
97+
timeout-minutes: 60
98+
strategy:
99+
fail-fast: false
100+
matrix:
101+
include:
102+
- target: x86_64-unknown-linux-gnu/gcc
103+
runner: ubuntu-24.04
104+
configure_flags: --with-pydebug
105+
- target: x86_64-unknown-linux-gnu/gcc-free-threading
106+
runner: ubuntu-24.04
107+
configure_flags: --disable-gil
108+
- target: aarch64-unknown-linux-gnu/gcc
109+
runner: ubuntu-24.04-arm
110+
configure_flags: --with-pydebug
111+
steps:
112+
- uses: actions/checkout@v6
113+
with:
114+
persist-credentials: false
115+
- uses: actions/setup-python@v6
116+
with:
117+
python-version: '3.11'
118+
- name: Build
118119
run: |
119-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
120-
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
121-
CC=clang-20 ./configure --with-tail-call-interp --with-pydebug
120+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ env.LLVM_VERSION }}
121+
export PATH="$(llvm-config-${{ env.LLVM_VERSION }} --bindir):$PATH"
122+
CC=clang-${{ env.LLVM_VERSION }} ./configure --with-tail-call-interp ${{ matrix.configure_flags }}
122123
make all --jobs 4
123-
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
124-
125-
- name: Native Linux with free-threading (release)
126-
if: matrix.target == 'free-threading'
124+
- name: Test
127125
run: |
128-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
129-
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
130-
CC=clang-20 ./configure --with-tail-call-interp --disable-gil
131-
make all --jobs 4
132126
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.14.10
3+
rev: v0.15.0
44
hooks:
55
- id: ruff-check
66
name: Run Ruff (lint) on Apple/
@@ -52,14 +52,14 @@ repos:
5252
files: ^Tools/wasm/
5353

5454
- repo: https://github.com/psf/black-pre-commit-mirror
55-
rev: 25.12.0
55+
rev: 26.1.0
5656
hooks:
5757
- id: black
5858
name: Run Black on Tools/jit/
5959
files: ^Tools/jit/
6060

6161
- repo: https://github.com/Lucas-C/pre-commit-hooks
62-
rev: v1.5.5
62+
rev: v1.5.6
6363
hooks:
6464
- id: remove-tabs
6565
types: [python]
@@ -83,19 +83,19 @@ repos:
8383
files: '^\.github/CODEOWNERS|\.(gram)$'
8484

8585
- repo: https://github.com/python-jsonschema/check-jsonschema
86-
rev: 0.36.0
86+
rev: 0.36.1
8787
hooks:
8888
- id: check-dependabot
8989
- id: check-github-workflows
9090
- id: check-readthedocs
9191

9292
- repo: https://github.com/rhysd/actionlint
93-
rev: v1.7.9
93+
rev: v1.7.10
9494
hooks:
9595
- id: actionlint
9696

9797
- repo: https://github.com/woodruffw/zizmor-pre-commit
98-
rev: v1.19.0
98+
rev: v1.22.0
9999
hooks:
100100
- id: zizmor
101101

Android/android.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def make_build_python(context):
208208
def unpack_deps(host, prefix_dir):
209209
os.chdir(prefix_dir)
210210
deps_url = "https://github.com/beeware/cpython-android-source-deps/releases/download"
211-
for name_ver in ["bzip2-1.0.8-3", "libffi-3.4.4-3", "openssl-3.0.18-0",
211+
for name_ver in ["bzip2-1.0.8-3", "libffi-3.4.4-3", "openssl-3.0.19-1",
212212
"sqlite-3.50.4-0", "xz-5.4.6-1", "zstd-1.5.7-1"]:
213213
filename = f"{name_ver}-{host}.tar.gz"
214214
download(f"{deps_url}/{name_ver}/{filename}")

Apple/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def unpack_deps(
316316
for name_ver in [
317317
"BZip2-1.0.8-2",
318318
"libFFI-3.4.7-2",
319-
"OpenSSL-3.0.18-1",
319+
"OpenSSL-3.0.19-1",
320320
"XZ-5.6.4-2",
321321
"mpdecimal-4.0.0-2",
322322
"zstd-1.5.7-1",

Doc/glossary.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,16 @@ Glossary
951951
to locks exist such as queues, producer/consumer patterns, and
952952
thread-local state. See also :term:`deadlock`, and :term:`reentrant`.
953953

954+
lock-free
955+
An operation that does not acquire any :term:`lock` and uses atomic CPU
956+
instructions to ensure correctness. Lock-free operations can execute
957+
concurrently without blocking each other and cannot be blocked by
958+
operations that hold locks. In :term:`free-threaded <free threading>`
959+
Python, built-in types like :class:`dict` and :class:`list` provide
960+
lock-free read operations, which means other threads may observe
961+
intermediate states during multi-step modifications even when those
962+
modifications hold the :term:`per-object lock`.
963+
954964
loader
955965
An object that loads a module.
956966
It must define the :meth:`!exec_module` and :meth:`!create_module` methods
@@ -1217,6 +1227,16 @@ Glossary
12171227
<faq-argument-vs-parameter>`, the :class:`inspect.Parameter` class, the
12181228
:ref:`function` section, and :pep:`362`.
12191229

1230+
per-object lock
1231+
A :term:`lock` associated with an individual object instance rather than
1232+
a global lock shared across all objects. In :term:`free-threaded
1233+
<free threading>` Python, built-in types like :class:`dict` and
1234+
:class:`list` use per-object locks to allow concurrent operations on
1235+
different objects while serializing operations on the same object.
1236+
Operations that hold the per-object lock prevent other locking operations
1237+
on the same object from proceeding, but do not block :term:`lock-free`
1238+
operations.
1239+
12201240
path entry
12211241
A single location on the :term:`import path` which the :term:`path
12221242
based finder` consults to find modules for importing.

Doc/library/asyncio-eventloop.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,9 @@ clocks to track time.
297297
are called is undefined.
298298

299299
The optional positional *args* will be passed to the callback when
300-
it is called. If you want the callback to be called with keyword
301-
arguments use :func:`functools.partial`.
300+
it is called. Use :func:`functools.partial`
301+
:ref:`to pass keyword arguments <asyncio-pass-keywords>` to
302+
*callback*.
302303

303304
An optional keyword-only *context* argument allows specifying a
304305
custom :class:`contextvars.Context` for the *callback* to run in.
@@ -1034,8 +1035,8 @@ Watching file descriptors
10341035
.. method:: loop.add_writer(fd, callback, *args)
10351036

10361037
Start monitoring the *fd* file descriptor for write availability and
1037-
invoke *callback* with the specified arguments once *fd* is available for
1038-
writing.
1038+
invoke *callback* with the specified arguments *args* once *fd* is
1039+
available for writing.
10391040

10401041
Any preexisting callback registered for *fd* is cancelled and replaced by
10411042
*callback*.
@@ -1308,7 +1309,8 @@ Unix signals
13081309

13091310
.. method:: loop.add_signal_handler(signum, callback, *args)
13101311

1311-
Set *callback* as the handler for the *signum* signal.
1312+
Set *callback* as the handler for the *signum* signal,
1313+
passing *args* as positional arguments.
13121314

13131315
The callback will be invoked by *loop*, along with other queued callbacks
13141316
and runnable coroutines of that event loop. Unlike signal handlers
@@ -1343,7 +1345,8 @@ Executing code in thread or process pools
13431345

13441346
.. awaitablemethod:: loop.run_in_executor(executor, func, *args)
13451347

1346-
Arrange for *func* to be called in the specified executor.
1348+
Arrange for *func* to be called in the specified executor
1349+
passing *args* as positional arguments.
13471350

13481351
The *executor* argument should be an :class:`concurrent.futures.Executor`
13491352
instance. The default executor is used if *executor* is ``None``.

0 commit comments

Comments
 (0)