Skip to content

Commit ba23ffe

Browse files
authored
Merge branch 'main' into fix-issue-129598
2 parents 4bce2f6 + 5d66c55 commit ba23ffe

File tree

267 files changed

+11702
-6617
lines changed

Some content is hidden

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

267 files changed

+11702
-6617
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ Objects/exceptions.c @iritkatriel
106106

107107
# Hashing & cryptographic primitives
108108
**/*hashlib* @gpshead @tiran @picnixz
109+
**/*hashopenssl* @gpshead @tiran @picnixz
109110
**/*pyhash* @gpshead @tiran
110111
**/sha* @gpshead @tiran @picnixz
111112
Modules/md5* @gpshead @tiran @picnixz

.github/workflows/build.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ jobs:
6262
with:
6363
fetch-depth: 1
6464
persist-credentials: false
65-
- name: Runner image version
66-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
6765
- name: Check Autoconf and aclocal versions
6866
run: |
6967
grep "Generated by GNU Autoconf 2.72" configure
@@ -104,14 +102,14 @@ jobs:
104102
with:
105103
python-version: '3.x'
106104
- name: Runner image version
107-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
105+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
108106
- name: Restore config.cache
109107
uses: actions/cache@v4
110108
with:
111109
path: config.cache
112110
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
113-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}-${{ env.pythonLocation }}
114-
- name: Install Dependencies
111+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}-${{ env.pythonLocation }}
112+
- name: Install dependencies
115113
run: sudo ./.github/workflows/posix-deps-apt.sh
116114
- name: Add ccache to PATH
117115
run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
@@ -247,13 +245,13 @@ jobs:
247245
- true
248246
os:
249247
- ubuntu-24.04
250-
- ubuntu-22.04-arm
248+
- ubuntu-24.04-arm
251249
exclude:
252250
# Do not test BOLT with free-threading, to conserve resources
253251
- bolt: true
254252
free-threading: true
255253
# BOLT currently crashes during instrumentation on aarch64
256-
- os: ubuntu-22.04-arm
254+
- os: ubuntu-24.04-arm
257255
bolt: true
258256
uses: ./.github/workflows/reusable-ubuntu.yml
259257
with:
@@ -284,15 +282,15 @@ jobs:
284282
with:
285283
persist-credentials: false
286284
- name: Runner image version
287-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
285+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
288286
- name: Restore config.cache
289287
uses: actions/cache@v4
290288
with:
291289
path: config.cache
292-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}
290+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
293291
- name: Register gcc problem matcher
294292
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
295-
- name: Install Dependencies
293+
- name: Install dependencies
296294
run: sudo ./.github/workflows/posix-deps-apt.sh
297295
- name: Configure OpenSSL env vars
298296
run: |
@@ -347,7 +345,7 @@ jobs:
347345
persist-credentials: false
348346
- name: Register gcc problem matcher
349347
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
350-
- name: Install Dependencies
348+
- name: Install dependencies
351349
run: sudo ./.github/workflows/posix-deps-apt.sh
352350
- name: Configure OpenSSL env vars
353351
run: |
@@ -379,12 +377,12 @@ jobs:
379377
- name: Bind mount sources read-only
380378
run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
381379
- name: Runner image version
382-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
380+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
383381
- name: Restore config.cache
384382
uses: actions/cache@v4
385383
with:
386384
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
387-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}
385+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
388386
- name: Configure CPython out-of-tree
389387
working-directory: ${{ env.CPYTHON_BUILDDIR }}
390388
run: |
@@ -466,15 +464,15 @@ jobs:
466464
with:
467465
persist-credentials: false
468466
- name: Runner image version
469-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
467+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
470468
- name: Restore config.cache
471469
uses: actions/cache@v4
472470
with:
473471
path: config.cache
474-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}
472+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
475473
- name: Register gcc problem matcher
476474
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
477-
- name: Install Dependencies
475+
- name: Install dependencies
478476
run: sudo ./.github/workflows/posix-deps-apt.sh
479477
- name: Set up GCC-10 for ASAN
480478
uses: egor-tensin/setup-gcc@v1
@@ -537,19 +535,19 @@ jobs:
537535
with:
538536
persist-credentials: false
539537
- name: Runner image version
540-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
538+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
541539
- name: Restore config.cache
542540
uses: actions/cache@v4
543541
with:
544542
path: config.cache
545-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}
543+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
546544
- name: Register gcc problem matcher
547545
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
548546
- name: Set build dir
549547
run:
550548
# an absolute path outside of the working directoy
551549
echo "BUILD_DIR=$(realpath ${{ github.workspace }}/../build)" >> "$GITHUB_ENV"
552-
- name: Install Dependencies
550+
- name: Install dependencies
553551
run: sudo ./.github/workflows/posix-deps-apt.sh
554552
- name: Configure host build
555553
run: ./configure --prefix="$BUILD_DIR/host-python"
@@ -621,6 +619,7 @@ jobs:
621619
- build_wasi
622620
- build_windows
623621
- build_windows_msi
622+
- cross-build-linux
624623
- test_hypothesis
625624
- build_asan
626625
- build_tsan
@@ -657,6 +656,7 @@ jobs:
657656
build_asan,
658657
build_tsan,
659658
test_hypothesis,
659+
cross-build-linux,
660660
'
661661
|| ''
662662
}}

.github/workflows/jit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
runner: ubuntu-24.04
8787
- target: aarch64-unknown-linux-gnu/gcc
8888
architecture: aarch64
89-
runner: ubuntu-22.04-arm
89+
runner: ubuntu-24.04-arm
9090
steps:
9191
- uses: actions/checkout@v4
9292
with:

.github/workflows/reusable-macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ jobs:
3535
with:
3636
persist-credentials: false
3737
- name: Runner image version
38-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
38+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
3939
- name: Restore config.cache
4040
uses: actions/cache@v4
4141
with:
4242
path: config.cache
43-
key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
43+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.config_hash }}
4444
- name: Install Homebrew dependencies
4545
run: |
4646
brew install pkg-config [email protected] xz gdbm tcl-tk@8 make

.github/workflows/reusable-tsan.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ jobs:
2525
with:
2626
persist-credentials: false
2727
- name: Runner image version
28-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
28+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
2929
- name: Restore config.cache
3030
uses: actions/cache@v4
3131
with:
3232
path: config.cache
33-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
34-
- name: Install Dependencies
33+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.config_hash }}
34+
- name: Install dependencies
3535
run: |
3636
sudo ./.github/workflows/posix-deps-apt.sh
3737
# Install clang-18
@@ -44,7 +44,7 @@ jobs:
4444
sudo update-alternatives --set clang++ /usr/bin/clang++-17
4545
# Reduce ASLR to avoid TSAN crashing
4646
sudo sysctl -w vm.mmap_rnd_bits=28
47-
- name: TSAN Option Setup
47+
- name: TSAN option setup
4848
run: |
4949
echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/Tools/tsan/suppressions${{
5050
fromJSON(inputs.free-threading)

.github/workflows/reusable-ubuntu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ jobs:
7878
- name: Bind mount sources read-only
7979
run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
8080
- name: Runner image version
81-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
81+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
8282
- name: Restore config.cache
8383
uses: actions/cache@v4
8484
with:
8585
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
86-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
86+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.config_hash }}
8787
- name: Configure CPython out-of-tree
8888
working-directory: ${{ env.CPYTHON_BUILDDIR }}
8989
# `test_unpickle_module_race` writes to the source directory, which is

.github/workflows/reusable-wasi.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,16 @@ jobs:
5353
uses: actions/setup-python@v5
5454
with:
5555
python-version: '3.x'
56+
- name: "Runner image version"
57+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
5658
- name: "Restore Python build config.cache"
5759
uses: actions/cache@v4
5860
with:
5961
path: ${{ env.CROSS_BUILD_PYTHON }}/config.cache
6062
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python.
6163
# Include the hash of `Tools/wasm/wasi.py` as it may change the environment variables.
6264
# (Make sure to keep the key in sync with the other config.cache step below.)
63-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi.py') }}-${{ env.pythonLocation }}
65+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi.py') }}-${{ env.pythonLocation }}
6466
- name: "Configure build Python"
6567
run: python3 Tools/wasm/wasi.py configure-build-python -- --config-cache --with-pydebug
6668
- name: "Make build Python"
@@ -70,7 +72,7 @@ jobs:
7072
with:
7173
path: ${{ env.CROSS_BUILD_WASI }}/config.cache
7274
# Should be kept in sync with the other config.cache step above.
73-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi.py') }}-${{ env.pythonLocation }}
75+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi.py') }}-${{ env.pythonLocation }}
7476
- name: "Configure host"
7577
# `--with-pydebug` inferred from configure-build-python
7678
run: python3 Tools/wasm/wasi.py configure-host -- --config-cache

.github/workflows/tail-call.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
- aarch64-apple-darwin/clang
4242
- x86_64-unknown-linux-gnu/gcc
4343
- aarch64-unknown-linux-gnu/gcc
44+
- free-threading
4445
llvm:
4546
- 19
4647
include:
@@ -64,7 +65,10 @@ jobs:
6465
runner: ubuntu-24.04
6566
- target: aarch64-unknown-linux-gnu/gcc
6667
architecture: aarch64
67-
runner: ubuntu-22.04-arm
68+
runner: ubuntu-24.04-arm
69+
- target: free-threading
70+
architecture: x86_64
71+
runner: ubuntu-24.04
6872
steps:
6973
- uses: actions/checkout@v4
7074
with:
@@ -105,11 +109,20 @@ jobs:
105109
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
106110
107111
- name: Native Linux (release)
108-
if: runner.os == 'Linux'
112+
if: runner.os == 'Linux' && matrix.target != 'free-threading'
109113
run: |
110114
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
111115
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
112116
CC=clang-19 ./configure --with-tail-call-interp
113117
make all --jobs 4
114118
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
115119
120+
- name: Native Linux with free-threading (release)
121+
if: matrix.target == 'free-threading'
122+
run: |
123+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
124+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
125+
CC=clang-19 ./configure --with-tail-call-interp --disable-gil
126+
make all --jobs 4
127+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
128+

Android/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ stderr. Add the `-v` option to also show Gradle output, and non-Python logcat
119119
messages.
120120

121121
Any other arguments on the `android.py test` command line will be passed through
122-
to `python -m test` use `--` to separate them from android.py's own options.
122+
to `python -m test` use `--` to separate them from android.py's own options.
123123
See the [Python Developer's
124124
Guide](https://devguide.python.org/testing/run-write-tests/) for common options
125-
 most of them will work on Android, except for those that involve subprocesses,
125+
most of them will work on Android, except for those that involve subprocesses,
126126
such as `-j`.
127127

128128
Every time you run `android.py test`, changes in pure-Python files in the

Doc/c-api/arg.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,10 @@ Building values
645645
``n`` (:class:`int`) [:c:type:`Py_ssize_t`]
646646
Convert a C :c:type:`Py_ssize_t` to a Python integer.
647647
648+
``p`` (:class:`bool`) [int]
649+
Convert a C :c:expr:`int` to a Python :class:`bool` object.
650+
.. versionadded:: 3.14
651+
648652
``c`` (:class:`bytes` of length 1) [char]
649653
Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` object of
650654
length 1.

0 commit comments

Comments
 (0)