Skip to content

Commit cd49a3b

Browse files
committed
Merge remote-tracking branch 'upstream/main' into GH-60729-add-ieee-wave-audio-support
# Conflicts: # Doc/library/wave.rst
2 parents f87efee + 745947c commit cd49a3b

File tree

99 files changed

+3010
-1437
lines changed

Some content is hidden

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

99 files changed

+3010
-1437
lines changed

.github/CODEOWNERS

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -260,33 +260,33 @@ Include/pyhash.h @gpshead @picnixz
260260
Python/pyhash.c @gpshead @picnixz
261261

262262
# The import system (including importlib)
263-
**/*import* @brettcannon @ericsnowcurrently @ncoghlan @warsaw
264-
Python/import.c @brettcannon @ericsnowcurrently @ncoghlan @warsaw @kumaraditya303
263+
**/*import* @brettcannon @ericsnowcurrently @ncoghlan @warsaw @FFY00
264+
Python/import.c @brettcannon @ericsnowcurrently @ncoghlan @warsaw @FFY00 @kumaraditya303
265265
**/*freeze* @ericsnowcurrently
266266
**/*frozen* @ericsnowcurrently
267267
**/*modsupport* @ericsnowcurrently
268-
**/*modulefinder* @ericsnowcurrently
268+
**/*modulefinder* @ericsnowcurrently @FFY00
269269
**/*moduleobject* @ericsnowcurrently
270270
**/*multiphase* @ericsnowcurrently
271-
**/*pkgutil* @ericsnowcurrently
271+
**/*pkgutil* @ericsnowcurrently @FFY00
272272
**/*pythonrun* @ericsnowcurrently
273-
**/*runpy* @ericsnowcurrently
273+
**/*runpy* @ericsnowcurrently @FFY00
274274
**/*singlephase* @ericsnowcurrently
275275
Doc/c-api/module.rst @ericsnowcurrently
276276
Lib/test/test_module/ @ericsnowcurrently
277-
Python/dynload_*.c @ericsnowcurrently
277+
Python/dynload_*.c @ericsnowcurrently @FFY00
278278

279279
# Initialisation
280-
**/*initconfig* @ericsnowcurrently
281-
**/*pathconfig* @ericsnowcurrently
282-
**/*preconfig* @ericsnowcurrently
280+
**/*initconfig* @ericsnowcurrently @FFY00
281+
**/*pathconfig* @ericsnowcurrently @FFY00
282+
**/*preconfig* @ericsnowcurrently @FFY00
283283
Doc/library/sys_path_init.rst @FFY00
284284
Doc/c-api/init_config.rst @FFY00
285285

286286
# Interpreter main program
287-
Modules/main.c @ericsnowcurrently
288-
Programs/_bootstrap_python.c @ericsnowcurrently
289-
Programs/python.c @ericsnowcurrently
287+
Modules/main.c @ericsnowcurrently @FFY00
288+
Programs/_bootstrap_python.c @ericsnowcurrently @FFY00
289+
Programs/python.c @ericsnowcurrently @FFY00
290290

291291
# JIT
292292
.github/workflows/jit.yml @savannahostrowski
@@ -316,8 +316,8 @@ Tools/peg_generator/ @pablogsal @lysnikolaou
316316

317317
# Runtime state/lifecycle
318318
**/*gil* @ericsnowcurrently
319-
**/*pylifecycle* @ericsnowcurrently @ZeroIntensity
320-
**/*pystate* @ericsnowcurrently @ZeroIntensity
319+
**/*pylifecycle* @ericsnowcurrently @ZeroIntensity @FFY00
320+
**/*pystate* @ericsnowcurrently @ZeroIntensity @FFY00
321321
Include/internal/pycore_*_init.h @ericsnowcurrently
322322
Include/internal/pycore_*_state.h @ericsnowcurrently
323323
Include/internal/pycore_atexit.h @ericsnowcurrently
@@ -505,13 +505,13 @@ Lib/idlelib/ @terryjreedy
505505
Lib/turtledemo/ @terryjreedy
506506

507507
# importlib.metadata
508-
Doc/library/importlib.metadata.rst @jaraco @warsaw
509-
Lib/importlib/metadata/ @jaraco @warsaw
510-
Lib/test/test_importlib/metadata/ @jaraco @warsaw
508+
Doc/library/importlib.metadata.rst @jaraco @warsaw @FFY00
509+
Lib/importlib/metadata/ @jaraco @warsaw @FFY00
510+
Lib/test/test_importlib/metadata/ @jaraco @warsaw @FFY00
511511

512512
# importlib.resources
513-
Doc/library/importlib.resources.abc.rst @jaraco @warsaw
514-
Doc/library/importlib.resources.rst @jaraco @warsaw
513+
Doc/library/importlib.resources.abc.rst @jaraco @warsaw @FFY00
514+
Doc/library/importlib.resources.rst @jaraco @warsaw @FFY00
515515
Lib/importlib/resources/ @jaraco @warsaw @FFY00
516516
Lib/test/test_importlib/resources/ @jaraco @warsaw @FFY00
517517

.github/workflows/build.yml

Lines changed: 35 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ jobs:
253253
os: ${{ matrix.os }}
254254
test-opts: ${{ matrix.test-opts || '' }}
255255

256-
build-ubuntu-ssltests-openssl:
257-
name: 'Ubuntu SSL tests with OpenSSL'
256+
build-ubuntu-ssltests:
257+
name: 'Ubuntu SSL tests'
258258
runs-on: ${{ matrix.os }}
259259
timeout-minutes: 60
260260
needs: build-context
@@ -263,16 +263,25 @@ jobs:
263263
fail-fast: false
264264
matrix:
265265
os: [ubuntu-24.04]
266-
# Keep 1.1.1w in our list despite it being upstream EOL and otherwise
267-
# unsupported as it most resembles other 1.1.1-work-a-like ssl APIs
268-
# supported by important vendors such as AWS-LC.
269-
openssl_ver: [1.1.1w, 3.0.19, 3.3.6, 3.4.4, 3.5.5, 3.6.1]
270-
# See Tools/ssl/make_ssl_data.py for notes on adding a new version
266+
ssllib:
267+
# See Tools/ssl/make_ssl_data.py for notes on adding a new version
268+
## OpenSSL
269+
# Keep 1.1.1w in our list despite it being upstream EOL and otherwise
270+
# unsupported as it most resembles other 1.1.1-work-a-like ssl APIs
271+
# supported by important vendors such as AWS-LC.
272+
- { name: openssl, version: 1.1.1w }
273+
- { name: openssl, version: 3.0.19 }
274+
- { name: openssl, version: 3.3.6 }
275+
- { name: openssl, version: 3.4.4 }
276+
- { name: openssl, version: 3.5.5 }
277+
- { name: openssl, version: 3.6.1 }
278+
## AWS-LC
279+
- { name: aws-lc, version: 1.68.0 }
271280
env:
272-
OPENSSL_VER: ${{ matrix.openssl_ver }}
281+
SSLLIB_VER: ${{ matrix.ssllib.version }}
273282
MULTISSL_DIR: ${{ github.workspace }}/multissl
274-
OPENSSL_DIR: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}
275-
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
283+
SSLLIB_DIR: ${{ github.workspace }}/multissl/${{ matrix.ssllib.name }}/${{ matrix.ssllib.version }}
284+
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/${{ matrix.ssllib.name }}/${{ matrix.ssllib.version }}/lib
276285
steps:
277286
- uses: actions/checkout@v6
278287
with:
@@ -283,89 +292,37 @@ jobs:
283292
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
284293
- name: Install dependencies
285294
run: sudo ./.github/workflows/posix-deps-apt.sh
286-
- name: Configure OpenSSL env vars
287-
run: |
288-
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
289-
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
290-
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
291-
- name: 'Restore OpenSSL build'
292-
id: cache-openssl
293-
uses: actions/cache@v5
294-
with:
295-
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
296-
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
297-
- name: Install OpenSSL
298-
if: steps.cache-openssl.outputs.cache-hit != 'true'
299-
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
300-
- name: Configure CPython
301-
run: ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl="$OPENSSL_DIR"
302-
- name: Build CPython
303-
run: make -j4
304-
- name: Display build info
305-
run: make pythoninfo
306-
- name: SSL tests
307-
run: ./python Lib/test/ssltests.py
308-
309-
build-ubuntu-ssltests-awslc:
310-
name: 'Ubuntu SSL tests with AWS-LC'
311-
runs-on: ${{ matrix.os }}
312-
timeout-minutes: 60
313-
needs: build-context
314-
if: needs.build-context.outputs.run-ubuntu == 'true'
315-
strategy:
316-
fail-fast: false
317-
matrix:
318-
os: [ubuntu-24.04]
319-
awslc_ver: [1.55.0]
320-
env:
321-
AWSLC_VER: ${{ matrix.awslc_ver}}
322-
MULTISSL_DIR: ${{ github.workspace }}/multissl
323-
OPENSSL_DIR: ${{ github.workspace }}/multissl/aws-lc/${{ matrix.awslc_ver }}
324-
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/aws-lc/${{ matrix.awslc_ver }}/lib
325-
steps:
326-
- uses: actions/checkout@v6
327-
with:
328-
persist-credentials: false
329-
- name: Runner image version
330-
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
331-
- name: Register gcc problem matcher
332-
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
333-
- name: Install dependencies
334-
run: sudo ./.github/workflows/posix-deps-apt.sh
335-
- name: Configure SSL lib env vars
336-
run: |
337-
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
338-
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/aws-lc/${AWSLC_VER}" >> "$GITHUB_ENV"
339-
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/aws-lc/${AWSLC_VER}/lib" >> "$GITHUB_ENV"
340-
- name: 'Restore AWS-LC build'
341-
id: cache-aws-lc
295+
- name: 'Restore SSL library build'
296+
id: cache-ssl-lib
342297
uses: actions/cache@v5
343298
with:
344-
path: ./multissl/aws-lc/${{ matrix.awslc_ver }}
345-
key: ${{ matrix.os }}-multissl-aws-lc-${{ matrix.awslc_ver }}
346-
- name: Install AWS-LC
347-
if: steps.cache-aws-lc.outputs.cache-hit != 'true'
299+
path: ./multissl/${{ matrix.ssllib.name }}/${{ matrix.ssllib.version }}
300+
key: ${{ matrix.os }}-multissl-${{ matrix.ssllib.name }}-${{ matrix.ssllib.version }}
301+
- name: Install SSL Library
302+
if: steps.cache-ssl-lib.outputs.cache-hit != 'true'
348303
run: |
349304
python3 Tools/ssl/multissltests.py \
350305
--steps=library \
351306
--base-directory "$MULTISSL_DIR" \
352-
--awslc ${{ matrix.awslc_ver }} \
307+
'--${{ matrix.ssllib.name }}' '${{ matrix.ssllib.version }}' \
353308
--system Linux
354309
- name: Configure CPython
355310
run: |
356311
./configure CFLAGS="-fdiagnostics-format=json" \
357312
--config-cache \
358313
--enable-slower-safety \
359314
--with-pydebug \
360-
--with-openssl="$OPENSSL_DIR" \
315+
--with-openssl="$SSLLIB_DIR" \
361316
--with-builtin-hashlib-hashes=blake2 \
362317
--with-ssl-default-suites=openssl
363318
- name: Build CPython
364-
run: make -j
319+
run: make -j4
365320
- name: Display build info
366321
run: make pythoninfo
367-
- name: Verify python is linked to AWS-LC
368-
run: ./python -c 'import ssl; print(ssl.OPENSSL_VERSION)' | grep AWS-LC
322+
- name: Verify python is linked to the right lib
323+
run: |
324+
./python -c 'import ssl; print(ssl.OPENSSL_VERSION)' \
325+
| grep -iE '${{ matrix.ssllib.name }}.*${{ matrix.ssllib.version }}'
369326
- name: SSL tests
370327
run: ./python Lib/test/ssltests.py
371328

@@ -691,8 +648,7 @@ jobs:
691648
- build-windows-msi
692649
- build-macos
693650
- build-ubuntu
694-
- build-ubuntu-ssltests-awslc
695-
- build-ubuntu-ssltests-openssl
651+
- build-ubuntu-ssltests
696652
- build-ios
697653
- build-wasi
698654
- test-hypothesis
@@ -709,8 +665,7 @@ jobs:
709665
allowed-failures: >-
710666
build-android,
711667
build-windows-msi,
712-
build-ubuntu-ssltests-awslc,
713-
build-ubuntu-ssltests-openssl,
668+
build-ubuntu-ssltests,
714669
test-hypothesis,
715670
cifuzz,
716671
allowed-skips: >-
@@ -741,8 +696,7 @@ jobs:
741696
!fromJSON(needs.build-context.outputs.run-ubuntu)
742697
&& '
743698
build-ubuntu,
744-
build-ubuntu-ssltests-awslc,
745-
build-ubuntu-ssltests-openssl,
699+
build-ubuntu-ssltests,
746700
test-hypothesis,
747701
build-asan,
748702
build-san,

.github/workflows/posix-deps-apt.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
apt-get update
33

4-
apt-get -yq install \
4+
apt-get -yq --no-install-recommends install \
55
build-essential \
66
pkg-config \
77
cmake \
@@ -31,4 +31,4 @@ apt-get -yq install \
3131
# https://deb.sury.org/
3232
sudo add-apt-repository ppa:ondrej/php
3333
apt-get update
34-
apt-get -yq install libmpdec-dev
34+
apt-get -yq --no-install-recommends install libmpdec-dev

.github/workflows/regen-abidump.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ set -ex
22

33
export DEBIAN_FRONTEND=noninteractive
44
./.github/workflows/posix-deps-apt.sh
5-
apt-get install -yq abigail-tools python3
5+
apt-get install -yq --no-install-recommends abigail-tools python3
66
export CFLAGS="-g3 -O0"
77
./configure --enable-shared && make
88
make regen-abidump

.github/workflows/reusable-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
restore-keys: |
9393
ubuntu-doc-
9494
- name: 'Install Dependencies'
95-
run: sudo ./.github/workflows/posix-deps-apt.sh && sudo apt-get install wamerican
95+
run: sudo ./.github/workflows/posix-deps-apt.sh && sudo apt-get install --no-install-recommends wamerican
9696
- name: 'Configure CPython'
9797
run: ./configure --with-pydebug
9898
- name: 'Build CPython'

.github/workflows/reusable-ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
if: ${{ fromJSON(inputs.bolt-optimizations) }}
4848
run: |
4949
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh 19
50-
sudo apt-get install bolt-19
50+
sudo apt-get install --no-install-recommends bolt-19
5151
echo PATH="$(llvm-config-19 --bindir):$PATH" >> $GITHUB_ENV
5252
- name: Configure OpenSSL env vars
5353
run: |

.github/workflows/verify-expat.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Verify bundled libexpat
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- 'Modules/expat/**'
8+
- '.github/workflows/verify-expat.yml'
9+
pull_request:
10+
paths:
11+
- 'Modules/expat/**'
12+
- '.github/workflows/verify-expat.yml'
13+
14+
permissions:
15+
contents: read
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
verify:
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 5
25+
steps:
26+
- uses: actions/checkout@v6
27+
with:
28+
persist-credentials: false
29+
- name: Download and verify bundled libexpat files
30+
run: |
31+
./Modules/expat/refresh.sh
32+
git diff --exit-code Modules/expat/

Doc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ build:
5858
@if [ -f ../Misc/NEWS ] ; then \
5959
echo "Using existing Misc/NEWS file"; \
6060
cp ../Misc/NEWS build/NEWS; \
61-
elif $(BLURB) help >/dev/null 2>&1 && $(SPHINXBUILD) --version >/dev/null 2>&1; then \
61+
elif $(BLURB) --version && $(SPHINXBUILD) --version ; then \
6262
if [ -d ../Misc/NEWS.d ]; then \
6363
echo "Building NEWS from Misc/NEWS.d with blurb"; \
6464
$(BLURB) merge -f build/NEWS; \

Doc/c-api/exceptions.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,8 @@ Signal Handling
699699
700700
- Executing a pending :ref:`remote debugger <remote-debugging>` script.
701701
702+
- Raise the exception set by :c:func:`PyThreadState_SetAsyncExc`.
703+
702704
If any handler raises an exception, immediately return ``-1`` with that
703705
exception set.
704706
Any remaining interruptions are left to be processed on the next
@@ -714,6 +716,9 @@ Signal Handling
714716
This function may now execute a remote debugger script, if remote
715717
debugging is enabled.
716718
719+
.. versionchanged:: next
720+
The exception set by :c:func:`PyThreadState_SetAsyncExc` is now raised.
721+
717722
718723
.. c:function:: void PyErr_SetInterrupt()
719724

Doc/c-api/threads.rst

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -699,13 +699,25 @@ pointer and a void pointer argument.
699699
700700
.. c:function:: int PyThreadState_SetAsyncExc(unsigned long id, PyObject *exc)
701701
702-
Asynchronously raise an exception in a thread. The *id* argument is the thread
703-
id of the target thread; *exc* is the exception object to be raised. This
704-
function does not steal any references to *exc*. To prevent naive misuse, you
705-
must write your own C extension to call this. Must be called with an :term:`attached thread state`.
706-
Returns the number of thread states modified; this is normally one, but will be
707-
zero if the thread id isn't found. If *exc* is ``NULL``, the pending
708-
exception (if any) for the thread is cleared. This raises no exceptions.
702+
Schedule an exception to be raised asynchronously in a thread.
703+
If the thread has a previously scheduled exception, it is overwritten.
704+
705+
The *id* argument is the thread id of the target thread, as returned by
706+
:c:func:`PyThread_get_thread_ident`.
707+
*exc* is the class of the exception to be raised, or ``NULL`` to clear
708+
the pending exception (if any).
709+
710+
Return the number of affected thread states.
711+
This is normally ``1`` if *id* is found, even when no change was
712+
made (the given *exc* was already pending, or *exc* is ``NULL`` but
713+
no exception is pending).
714+
If the thread id isn't found, return ``0``. This raises no exceptions.
715+
716+
To prevent naive misuse, you must write your own C extension to call this.
717+
This function must be called with an :term:`attached thread state`.
718+
This function does not steal any references to *exc*.
719+
This function does not necessarily interrupt system calls such as
720+
:py:func:`~time.sleep`.
709721
710722
.. versionchanged:: 3.7
711723
The type of the *id* parameter changed from :c:expr:`long` to
@@ -743,7 +755,8 @@ Operating system thread APIs
743755
:term:`attached thread state`.
744756
745757
.. seealso::
746-
:py:func:`threading.get_ident`
758+
:py:func:`threading.get_ident` and :py:attr:`threading.Thread.ident`
759+
expose this identifier to Python.
747760
748761
749762
.. c:function:: PyObject *PyThread_GetInfo(void)

0 commit comments

Comments
 (0)