Commit graph

4822 commits

Author SHA1 Message Date
Hood Chatham
7c8a46bcce
[3.14] gh-146197: Add Emscripten to CI (GH-146198) (GH-146331)
(cherry picked from commit c94048be02)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-24 00:13:16 +01:00
Sam Gross
fa3143a1d2
[3.14] gh-145779: Improve classmethod/staticmethod scaling in free-threaded build (gh-145826) (#146088)
Add special cases for classmethod and staticmethod descriptors in
_PyObject_GetMethodStackRef() to avoid calling tp_descr_get, which
avoids reference count contention on the bound method and underlying
callable. This improves scaling when calling classmethods and
staticmethods from multiple threads.

Also refactor method_vectorcall in classobject.c into a new
_PyObject_VectorcallPrepend() helper so that it can be used by
PyObject_VectorcallMethod as well.

(cherry picked from commit e0f7c1097e)
2026-03-19 10:49:12 -04:00
Serhiy Storchaka
a005f323b7
[3.14] gh-144545: Improve handling of default values in Argument Clinic (GH-146016) (GH-146052)
* Add the c_init_default attribute which is used to initialize the C variable
  if the default is not explicitly provided.
* Add the c_default_init() method which is used to derive c_default from
  default if c_default is not explicitly provided.
* Explicit c_default and py_default are now almost always have precedence
  over the generated value.
* Add support for bytes literals as default values.
* Improve support for str literals as default values (support non-ASCII
  and non-printable characters and special characters like backslash or quotes).
* Fix support for str and bytes literals containing trigraphs, "/*" and "*/".
* Improve support for default values in converters "char" and "int(accept={str})".
* Converter "int(accept={str})" now requires 1-character string instead of
  integer as default value.
* Add support for non-None default values in converter "Py_buffer": NULL,
  str and bytes literals.
* Improve error handling for invalid default values.
* Rename Null to NullType for consistency.
(cherry picked from commit 99e2c5eccd)
2026-03-17 10:55:15 +00:00
Miss Islington (bot)
f06961e044
[3.14] gh-145176 Move Emscripten files into Platforms/emscripten (GH-145806) (#146043)
Moves Emscripten build files into Platforms/emscripten.
(cherry picked from commit 1b118353bb)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2026-03-17 10:17:47 +08:00
Miss Islington (bot)
54fd6766d2
[3.14] Bump mypy to 1.19.1 (GH-145956) (#145971)
Bump mypy to 1.19.1 (GH-145956)
(cherry picked from commit e167e06f8c)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2026-03-15 10:16:05 +00:00
Stan Ulbrych
87fac9b8ee
[3.14] gh-145783: Propagate errors raised in NEW_TYPE_COMMENT (GH-145784) (#145926) 2026-03-13 18:08:04 +00:00
Sam Gross
6d28aaf24d
[3.14] gh-145685: Avoid contention on TYPE_LOCK in super() lookups (gh-145775) (#145804)
(cherry picked from commit bdf6de8c3f)
2026-03-11 11:50:13 +00:00
Miss Islington (bot)
e5d8d80bdf
[3.14] gh-145219: Cache Emscripten build dependencies, add install-emscripten (GH-145664) (#145790)
Modifies the Emscripten build script to allow for caching of dependencies, and
for automated installation of new EMSDK versions.
(cherry picked from commit ebb150e76a)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2026-03-11 00:50:36 +00:00
Miss Islington (bot)
b194688703
[3.14] gh-145219: Add Emscripten cross-build and clean configurability (GH-145581) (#145654)
Modifies the Emscripten build script to allow for custom cross-build directory
names, and to only clean Emscripten-specific paths (optionally including the
build python).
(cherry picked from commit 015613384f)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2026-03-09 02:52:56 +00:00
Miss Islington (bot)
ae6c211e98
[3.14] gh-145177: Support multiple Emscripten versions for Emscripten buildbot (GH-145180) (#145582)
Adds an `--emsdk-cache` argument to the Emscripten build script and an
emscripten_version.txt file. If the `--emsdk-cache` argument is passed, the build script
will look in `emscripten_version.txt` to get the expected emsdk version is installed in
a folder called e.g., 4.0.12 in the directory indicated by the `--emsdk-cache` argument,
and run the build with that Emscripten tooling activated.
(cherry picked from commit c3fb0d9d96)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2026-03-09 06:14:15 +08:00
Miss Islington (bot)
bded835b72
[3.14] gh-141004: Document missing type flags (GH-145127) (GH-145316)
gh-141004: Document missing type flags (GH-145127)
(cherry picked from commit dc1b56aa03)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-02-27 15:17:35 +00:00
Peter Bierma
8e29215e04
[3.14] gh-141004: Document PyModuleDef_Type (GH-145043) (GH-145146)
(cherry picked from commit 24cc998c16)
2026-02-23 15:24:29 +00:00
Stan Ulbrych
8e482eb1ec
[3.14] compute-changes.py: Fix & test process_changed_files() (GH-144674) (#145013)
Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2026-02-21 14:24:35 +02:00
Serhiy Storchaka
bcabbd02f6
[3.14] gh-80667: Fix lookup for Tangut ideographs in unicodedata (GH-144789) (GH-144871)
(cherry picked from commit 8b7b5a9946)

Co-authored-by: Pierre Le Marre <dev@wismill.eu>
2026-02-16 14:25:43 +02:00
Zachary Ware
c7ceb75ada
[3.14] gh-144551: Update CI to use latest OpenSSL versions (GH-144794) (#144799)
[3.14] gh-144551: Update CI to use latest OpenSSL versions

Also update _ssl_data_35.h to include an added symbol from 3.5.5.

(cherry picked from commit b933ef9261)
2026-02-13 22:31:27 +02:00
Miss Islington (bot)
2cc0720bdb
[3.14] gh-144492: Fix process_changed_files outputs for reusable-{macos, wasi}.yml (GH-144518) (#144635)
gh-144492: Fix `process_changed_files` outputs for `reusable-{macos, wasi}.yml` (GH-144518)

Fix `process_changed_files` double-processing reusable-{macos, wasi] ending up with incorrect outputs
(cherry picked from commit fd190d1fa1)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-09 17:57:43 +00:00
Miss Islington (bot)
e3d05d2dd6
[3.14] gh-141004: Document remaining pyport.h utility macros (GH-144279) (GH-144477)
gh-141004: Document remaining `pyport.h` utility macros (GH-144279)
(cherry picked from commit 914fbec214)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-02-04 16:49:41 +00:00
Seth Michael Larson
daae1279ad
[3.14] gh-143572: Run 'python3-libraries' fuzzer in CI using CIFuzz (… (#143912)
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <578543+webknjaz@users.noreply.github.com>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-01-16 19:24:30 +02:00
Miss Islington (bot)
bbd11568a7
[3.14] gh-143054: Disallow non-top-level Cut for now (GH-143622) (GH-143790)
The behaviour of Cut in nested parentheses, Repeat, Opt, and similar
is somewhat chaotic. Apparently even the academic papers on PEG aren't
as clear as they could be.

And it doesn't really matter. Python only uses top-level cuts.
When that changes, we can clarify as much as necessary (and even
change the implementation to make sense for what we'll need).

Document that this is deliberately unspecified, and add a test to
make sure any decision is deliberate, tested and documented.
(cherry picked from commit f0a0467c17)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-01-15 13:52:39 +01:00
Miss Islington (bot)
37c4a6551a
[3.14] gh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCAL_SYMBOL,Py_IMPORTED_SYMBOL) (GH-143508) (GH-143786)
(cherry picked from commit a7ba3b124f)

Co-authored-by: Yashraj <yashrajpala8@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-15 13:34:27 +01:00
Miss Islington (bot)
fd174d76de
[3.14] gh-141004: Document several soft-deprecated C APIs (GH-141634) (GH-143837)
gh-141004: Document several soft-deprecated C APIs (GH-141634)
(cherry picked from commit 0e0d51cdce)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-14 13:25:57 +00:00
Petr Viktorin
9c834b4f84
[3.14] gh-141004: Document PyUnicode_IS_COMPACT and PyUnicode_IS_COMPACT_ASCII macros (GH-143494) (GH-143785)
(cherry picked from commit 42f7c2dfba)

Co-authored-by: Yashraj <yashrajpala8@gmail.com>
2026-01-13 19:06:23 +01:00
Miss Islington (bot)
a705f57678
[3.14] gh-141004: Don't trigger run-tests when Tools/check-c-api-docs/ignored_c_api.txt is changed (GH-143583) (GH-143793)
gh-141004: Don't trigger `run-tests` when `Tools/check-c-api-docs/ignored_c_api.txt` is changed (GH-143583)
(cherry picked from commit 1176facbf2)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-01-13 13:53:59 +00:00
Petr Viktorin
deb75a5296
[3.14] gh-141004: Improve make check-c-api-docs (GH-143564) (GH-143593)
- Gather all documented names into a set in a single pass.
  This makes the check much faster.

- Do not match substrings (e.g. documenting `PyErr_WarnEx`
  doesn't mean that `PyErr_Warn` is documented)

- Consider `PY`-prefixed names (a lot of old macros use this)

(cherry picked from commit 234a15dc4e)
2026-01-12 14:04:39 +01:00
Miss Islington (bot)
0f02dbe4ab
[3.14] gh-142095: Use thread local frame info in py-bt and py-bt-full when available (gh-143371) (#143566)
In optimized and `-Og` builds, arguments and local variables are frequently
unavailable in gdb. This makes `py-bt` fail to print anything useful. Use the
`PyThreadState*` pointers `_Py_tss_gilstate` and `Py_tss_tstate` to find the
interpreter frame if we can't get the frame from the
`_PyEval_EvalFrameDefault` call.
(cherry picked from commit 49c3b0a67a)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-08 12:35:31 -05:00
Miss Islington (bot)
eb1284eb26
[3.14] gh-142859: Add Tools/check-c-api-docs to mypy check (GH-142860) (#142871)
gh-142859: Add `Tools/check-c-api-docs` to mypy check (GH-142860)
(cherry picked from commit 248eb3efb3)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-12-17 11:50:22 +00:00
Stan Ulbrych
b317c60e04
[3.14] gh-142278: Add granular change detection for platforms in CI (GH-142350) (#142537)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-12-11 09:16:13 +02:00
Miss Islington (bot)
7621bbd828
[3.14] gh-142454: Make the JIT digest more deterministic by sorting the files in Tools/jit (GH-142455) (#142485)
gh-142454: Make the JIT digest more deterministic by sorting the files in Tools/jit (GH-142455)
(cherry picked from commit bcf90de8ba)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2025-12-09 18:50:53 +00:00
Miss Islington (bot)
8cb65ca1dd
[3.14] gh-138061: Exclude __pycache__ directory from the computed digest in the JIT stencils (GH-138131) (#142482)
Co-authored-by: alm <alonme@users.noreply.github.com>
2025-12-09 18:18:14 +00:00
Miss Islington (bot)
20b454d272
[3.14] Fix typo in Tools/wasm/README.md (GH-142426) (GH-142429)
Fix typo in `Tools/wasm/README.md` (GH-142426)
(cherry picked from commit 719d7960e2)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-12-08 20:54:24 +00:00
Miss Islington (bot)
5a639ca1b3
[3.14] Introduce build-python and build-host subcommands for Tools/wasm/wasi (GH-142266) (#142322)
Introduce `build-python` and `build-host` subcommands for `Tools/wasm/wasi` (GH-142266)

It should make it easier when you need to rebuild just the e.g. host Python, but it requires ./configure to run.
(cherry picked from commit 58e1c7a16f)

Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-12-05 15:04:50 -08:00
Peter Bierma
d069edc9e8
[3.14] gh-141004: Add a CI job ensuring that new C APIs include documentation (GH-142102) (GH-142247)
* gh-141004: Add a CI job ensuring that new C APIs include documentation (GH-142102)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
(cherry picked from commit 1a7824a927)

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-12-04 08:07:39 -05:00
Miss Islington (bot)
afaa3b02f7
[3.14] Being more flexible in when not to explicitly set the sysroot when compiling for WASI (GH-142242) (GH-142246)
Being more flexible in when not to explicitly set the sysroot when compiling for WASI (GH-142242)
(cherry picked from commit c5252045d3)

Co-authored-by: Brett Cannon <brett@python.org>
2025-12-04 00:16:37 +00:00
Sam Gross
b7c25eabd6
[3.14] gh-139103: fix free-threading dataclass.__init__ perf issue (gh-141596) (gh-141750)
The dataclasses `__init__` function is generated dynamically by a call to `exec()` and so doesn't have deferred reference counting enabled. Enable deferred reference counting on functions when assigned as an attribute to type objects to avoid reference count contention when creating dataclass instances.
(cherry picked from commit ce79154176)

Co-authored-by: Edward Xu <xuxiangad@gmail.com>
2025-11-19 15:00:51 +00:00
Miss Islington (bot)
79195df23c
[3.14] gh-140260: fix data race in _struct module initialization with subinterpreters (GH-140909) (#141501)
gh-140260: fix data race in `_struct` module initialization with subinterpreters (GH-140909)
(cherry picked from commit 63548b3699)

Co-authored-by: Shamil <ashm.tech@proton.me>
2025-11-13 17:23:22 +05:30
Hugo van Kemenade
7168553c00
[3.14] gh-138189: Document type slots, and other constants, as part of Limited API (GH-138190) (GH-141131)
(cherry picked from commit d81e1ef0f3)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-06 12:39:19 +01:00
Miss Islington (bot)
ab1fdf3d7c
[3.14] gh-140312: Set lltrace on JIT debug builds (GH-140313) (#140887)
gh-140312: Set lltrace on JIT debug builds (GH-140313)
(cherry picked from commit f701f98052)

Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: Mark Shannon <mark@hotpy.org>
2025-11-01 16:49:35 +00:00
Miss Islington (bot)
6c025a040d
[3.14] Make printing log lines to the terminal a little cleaner when building WASI (GH-140772) (GH-140804)
Make printing log lines to the terminal a little cleaner when building WASI (GH-140772)
(cherry picked from commit abd19eddee)

Co-authored-by: Brett Cannon <brett@python.org>
2025-10-30 18:02:10 +00:00
Miss Islington (bot)
e595d995c4
[3.14] GH-140768: Warn when the WASI SDK version doesn't match the supported version (GH-140769) (GH-140801)
GH-140768: Warn when the WASI SDK version doesn't match the supported version (GH-140769)
(cherry picked from commit 95a3564869)

Co-authored-by: Brett Cannon <brett@python.org>
2025-10-30 17:01:22 +00:00
Miss Islington (bot)
5848d80536
[3.14] gh-139590: Stricter ruff rules for Tools/wasm (GH-139752) (#139811)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-14 10:29:32 +03:00
Miss Islington (bot)
7c03e9078d
[3.14] GH-129805: Clean up some changes from GH-129806 (GH-133540) (#138972)
Co-authored-by: Brandt Bucher <brandt@python.org>
2025-10-09 14:12:25 +03:00
Kumar Aditya
90cd009209
[3.14] gh-139748: fix leaks in AC error paths when using unicode FS-b… (#139789)
* [3.14] gh-139748: fix leaks in AC error paths when using unicode FS-based converters (GH-139765)
(cherry picked from commit b04a57deef)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-08 22:16:21 +05:30
Miss Islington (bot)
c5ab1b7661
[3.14] GH-139590: Run ruff format on pre-commit for Tools/wasm (GH-139591) (#139744)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-08 08:11:09 -07:00
Miss Islington (bot)
297157d968
[3.14] gh-92266: Update pre-commit (GH-139411) (#139466)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-08 13:25:17 +03:00
Miss Islington (bot)
9e0b7d0866
[3.14] GH-137484: Have Tools/wasm/wasi use the build triple instead of "build" (GH-137485) (#137487)
GH-137484: Have `Tools/wasm/wasi` use the build triple instead of "build" (GH-37485)

This should help prevent issuse where something like a container is used to do one build and then someone tries to build again locally.
(cherry picked from commit 0953200b13)

Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-08 02:11:31 +00:00
Miss Islington (bot)
6b090c9272
[3.14] GH-137248: Add a --logdir option to Tools/wasm/wasi (GH-137249) (GH-137252)
GH-137248: Add a `--logdir` option to `Tools/wasm/wasi` (GH-137249)
(cherry picked from commit 94498a53f3)

Co-authored-by: Brett Cannon <brett@python.org>
2025-10-07 23:51:19 +00:00
Miss Islington (bot)
9f97fa30f8
[3.14] GH-137243: Have Tools/wasm/wasi detect WASI SDK installs in /opt when the release tarball is extracted (GH-137244) (GH-137250)
GH-137243: Have `Tools/wasm/wasi` detect WASI SDK installs in `/opt` when the release tarball is extracted (GH-137244)
(cherry picked from commit 2f1a9f2ed4)

Co-authored-by: Brett Cannon <brett@python.org>
2025-10-07 23:13:35 +00:00
Miss Islington (bot)
e953cead61
[3.14] Touch up Setup.local handling in Tools/wasm/wasi (GH-137051) (GH-137053)
Touch up `Setup.local` handling in `Tools/wasm/wasi` (GH-137051)

The comment in the generated file is now more self-explanatory. The checks for unexpected file contents are also strengthened.
(cherry picked from commit ec7fad79d2)

Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Zachary Ware <zach@python.org>
2025-10-07 20:58:53 +00:00
Serhiy Storchaka
9ec4e3838a
[3.14] gh-138264: Fix gcc 14 compiler warnings (GH-138265) (GH-138426)
(cherry picked from commit 4a33077fdb)
2025-10-07 22:26:05 +02:00
Miss Islington (bot)
db8b943259
[3.14] GH-92266: Remove embedded tabs from `c-analyzer/cpython/_parser.py` (GH-137622) (#139718)
GH-92266: Remove embedded tabs from ``c-analyzer/cpython/_parser.py`` (GH-137622)
(cherry picked from commit 2212ae5557)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-07 18:45:49 +00:00