Skip to content

Commit 3d1b593

Browse files
Merge branch 'main' into dis-theme-support
2 parents e1bdf60 + b1e32ff commit 3d1b593

748 files changed

Lines changed: 27098 additions & 9117 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/CODEOWNERS‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,10 @@ Programs/_bootstrap_python.c @ericsnowcurrently @FFY00
283283
Programs/python.c @ericsnowcurrently @FFY00
284284

285285
# JIT
286-
.github/workflows/jit.yml @savannahostrowski
287-
Include/internal/pycore_jit.h @brandtbucher @savannahostrowski @diegorusso
288-
Python/jit.c @brandtbucher @savannahostrowski @diegorusso
289-
Tools/jit/ @brandtbucher @savannahostrowski @diegorusso
290-
InternalDocs/jit.md @brandtbucher @savannahostrowski @diegorusso @AA-Turner
286+
Include/internal/pycore_jit.h @brandtbucher @diegorusso
287+
Python/jit.c @brandtbucher @diegorusso
288+
Tools/jit/ @brandtbucher @diegorusso
289+
InternalDocs/jit.md @brandtbucher @diegorusso @AA-Turner
291290

292291
# Lazy imports (PEP 810)
293292
.github/workflows/reusable-test-lazy-imports-all.yml @yhg1s @DinoV @pablogsal
@@ -297,9 +296,9 @@ Lib/test/test_lazy_import @yhg1s @DinoV @pablogsal
297296

298297
# Micro-op / μop / Tier 2 Optimiser
299298
Python/optimizer.c @markshannon @Fidget-Spinner
300-
Python/optimizer_analysis.c @markshannon @tomasr8 @Fidget-Spinner @savannahostrowski
301-
Python/optimizer_bytecodes.c @markshannon @tomasr8 @Fidget-Spinner @savannahostrowski
302-
Python/optimizer_symbols.c @markshannon @tomasr8 @Fidget-Spinner @savannahostrowski
299+
Python/optimizer_analysis.c @markshannon @tomasr8 @Fidget-Spinner
300+
Python/optimizer_bytecodes.c @markshannon @tomasr8 @Fidget-Spinner
301+
Python/optimizer_symbols.c @markshannon @tomasr8 @Fidget-Spinner
303302

304303
# Parser, Lexer, and Grammar
305304
Grammar/python.gram @pablogsal @lysnikolaou

‎.github/VULNERABILITY_REPORT.yml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ body:
5151
- "3.15"
5252
- "3.16"
5353
- "CPython main branch"
54-
validations:
55-
required: true
5654
- type: textarea
5755
id: patch
5856
attributes:

‎.github/workflows/build.yml‎

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -491,53 +491,6 @@ jobs:
491491
if: fromJSON(needs.build-context.outputs.run-tests)
492492
uses: ./.github/workflows/reusable-test-lazy-imports-all.yml
493493

494-
build-asan:
495-
name: 'Address sanitizer'
496-
runs-on: ${{ matrix.os }}
497-
timeout-minutes: 60
498-
needs: build-context
499-
if: needs.build-context.outputs.run-ubuntu == 'true'
500-
strategy:
501-
fail-fast: false
502-
matrix:
503-
os: [ubuntu-26.04]
504-
env:
505-
OPENSSL_VER: 3.5.9
506-
PYTHONSTRICTEXTENSIONBUILD: 1
507-
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
508-
steps:
509-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
510-
with:
511-
persist-credentials: false
512-
- name: Runner image version
513-
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
514-
- name: Register gcc problem matcher
515-
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
516-
- name: Install dependencies
517-
run: sudo ./.github/workflows/posix-deps-apt.sh
518-
- name: Configure OpenSSL env vars
519-
run: |
520-
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
521-
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
522-
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
523-
- name: 'Restore OpenSSL build'
524-
id: cache-openssl
525-
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
526-
with:
527-
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
528-
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
529-
- name: Install OpenSSL
530-
if: steps.cache-openssl.outputs.cache-hit != 'true'
531-
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
532-
- name: Configure CPython
533-
run: ./configure --config-cache --with-address-sanitizer --without-pymalloc --with-openssl="$OPENSSL_DIR"
534-
- name: Build CPython
535-
run: make -j4
536-
- name: Display build info
537-
run: make pythoninfo
538-
- name: Tests
539-
run: xvfb-run make ci
540-
541494
build-san:
542495
# ${{ '' } is a hack to nest jobs under the same sidebar category.
543496
name: Sanitizers${{ '' }} # zizmor: ignore[obfuscation]
@@ -554,6 +507,9 @@ jobs:
554507
sanitizer:
555508
- TSan
556509
include:
510+
- check-name: Address
511+
sanitizer: ASan
512+
free-threading: false
557513
- check-name: Undefined behavior
558514
sanitizer: UBSan
559515
free-threading: false
@@ -667,7 +623,6 @@ jobs:
667623
- build-wasi
668624
- test-hypothesis
669625
- test-lazy-imports-all
670-
- build-asan
671626
- build-san
672627
- cross-build-linux
673628
- cifuzz
@@ -714,7 +669,6 @@ jobs:
714669
build-ubuntu-installed,
715670
build-ubuntu-ssltests,
716671
test-hypothesis,
717-
build-asan,
718672
build-san,
719673
cross-build-linux,
720674
'

‎.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-san.yml‎

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ jobs:
4343
# please update the versions in `Tools/pixi-packages/variants.yaml` too.
4444
echo "CC=clang" >> "$GITHUB_ENV"
4545
echo "CXX=clang++" >> "$GITHUB_ENV"
46+
- name: ASan option setup
47+
if: inputs.sanitizer == 'ASan'
48+
run: |
49+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
50+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
51+
echo "ASAN_OPTIONS=${SAN_LOG_OPTION} detect_leaks=0 allocator_may_return_null=1 handle_segv=0" >> "$GITHUB_ENV"
52+
echo "PYTHONSTRICTEXTENSIONBUILD=1" >> "$GITHUB_ENV"
53+
env:
54+
SAN_LOG_OPTION: log_path=${{ github.workspace }}/san_log
4655
- name: TSan option setup
4756
if: inputs.sanitizer == 'TSan'
4857
run: |
@@ -88,24 +97,27 @@ jobs:
8897
- name: Add ccache to PATH
8998
run: |
9099
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
91-
- name: 'Restore OpenSSL build (TSan)'
100+
- name: 'Restore OpenSSL build'
92101
id: cache-openssl
93-
if: inputs.sanitizer == 'TSan'
102+
if: inputs.sanitizer == 'TSan' || inputs.sanitizer == 'ASan'
94103
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
95104
with:
96105
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
97-
key: ${{ env.IMAGE_OS_VERSION }}-multissl-openssl-tsan-${{ env.OPENSSL_VER }}
98-
- name: Install OpenSSL (TSan)
106+
key: >-
107+
${{ env.IMAGE_OS_VERSION }}-multissl-openssl-${{
108+
inputs.sanitizer == 'TSan' && 'tsan-' || ''
109+
}}${{ env.OPENSSL_VER }}
110+
- name: Install OpenSSL
99111
if: >-
100-
inputs.sanitizer == 'TSan'
112+
(inputs.sanitizer == 'TSan' || inputs.sanitizer == 'ASan')
101113
&& steps.cache-openssl.outputs.cache-hit != 'true'
102114
run: >-
103115
python3 Tools/ssl/multissltests.py
104116
--steps=library
105117
--base-directory="${MULTISSL_DIR}"
106118
--openssl="${OPENSSL_VER}"
107119
--system=Linux
108-
--tsan
120+
${{ inputs.sanitizer == 'TSan' && '--tsan' || '' }}
109121
# gh-157958: -O2 instead of the pydebug default -Og to avoid a clang 21
110122
# compile-time blowup on some interpreter files.
111123
# (https://github.com/llvm/llvm-project/issues/179695)
@@ -117,14 +129,20 @@ jobs:
117129
--config-cache
118130
OPT="-O2 -g"
119131
${{
120-
inputs.sanitizer == 'TSan'
132+
inputs.sanitizer == 'ASan'
133+
&& '--with-address-sanitizer --without-pymalloc'
134+
|| inputs.sanitizer == 'TSan'
121135
&& '--with-thread-sanitizer'
122136
|| inputs.sanitizer == 'MSan'
123137
&& '--with-memory-sanitizer'
124138
|| '--with-undefined-behavior-sanitizer --with-strict-overflow'
125139
}}
126140
${{ inputs.sanitizer == 'MSan' && '--with-assertions' || '--with-pydebug' }}
127-
${{ inputs.sanitizer == 'TSan' && '--with-openssl="$OPENSSL_DIR" --with-openssl-rpath=auto' || '' }}
141+
${{
142+
(inputs.sanitizer == 'TSan' || inputs.sanitizer == 'ASan')
143+
&& '--with-openssl="$OPENSSL_DIR" --with-openssl-rpath=auto'
144+
|| ''
145+
}}
128146
${{ inputs.free-threading && '--disable-gil' || '' }}
129147
- name: Build CPython
130148
run: make -j4

‎.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

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ Python/frozen_modules/MANIFEST
180180

181181
# Local AI agent scratch state (per-PR and per-branch notebooks, sandbox
182182
# experiments) and personal agent overrides, none of which are committed.
183+
/do-not-commit/
183184
/.claude/pr-*
184185
/.claude/branch-*
185186
/.claude/sandbox/

‎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/c-api/code.rst‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ bound into a function.
176176
177177
.. versionadded:: 3.12
178178
179+
.. c:macro:: PY_FOREACH_CODE_EVENT(V)
180+
181+
Apply the macro *V* to each suffix of :c:type:`PyCodeEvent`
182+
constants.
183+
Currently expands to ``V(CREATE) V(DESTROY)``.
184+
The macro *V* must accept one event name and supply any punctuation
185+
needed between expansions.
186+
179187
.. c:type:: int (*PyCode_WatchCallback)(PyCodeEvent event, PyCodeObject* co)
180188
181189
Type of a code object watcher callback function.

‎Doc/c-api/conversion.rst‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,23 @@ The argument must be a signed or unsigned :c:expr:`char`.
258258
.. c:macro:: Py_TOUPPER(c)
259259
260260
Return the uppercase equivalent of the character *c*.
261+
262+
263+
Bit masks
264+
---------
265+
266+
The following constants are bit masks used by the character classification
267+
macros above:
268+
269+
.. c:macro:: PY_CTF_ALNUM
270+
PY_CTF_ALPHA
271+
PY_CTF_DIGIT
272+
PY_CTF_LOWER
273+
PY_CTF_SPACE
274+
PY_CTF_UPPER
275+
PY_CTF_XDIGIT
276+
277+
Values used internally by the ``Py_IS*`` classification macros above.
278+
Exposed for backwards compatibility only.
279+
280+
.. soft-deprecated:: next

0 commit comments

Comments
 (0)