]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 months agogh-137314: Fix incorrect treatment of format specs in raw fstrings (#137328)
Pablo Galindo Salgado [Sun, 3 Aug 2025 16:10:51 +0000 (17:10 +0100)] 
gh-137314: Fix incorrect treatment of format specs in raw fstrings (#137328)

3 months agogh-132983: Fix docstrings in ``ZstdDict`` (#137321)
Rogdham [Sun, 3 Aug 2025 15:04:45 +0000 (17:04 +0200)] 
gh-132983: Fix docstrings in ``ZstdDict`` (#137321)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
3 months agogh-137191: Fix how type parameters are collected from `Protocol` and `Generic` bases...
sobolevn [Sun, 3 Aug 2025 07:40:55 +0000 (10:40 +0300)] 
gh-137191: Fix how type parameters are collected from `Protocol` and `Generic` bases with parameters (#137281)

3 months agoGH-137276: Don't mark uop as escaping if the escaping call is on an exit branch ...
Mark Shannon [Sat, 2 Aug 2025 15:49:34 +0000 (16:49 +0100)] 
GH-137276: Don't mark uop as escaping if the escaping call is on an exit branch (GH-137277)

3 months agoRemove incorrect feature coverage comment from msgfmt script's docstring (#112862)
Maciej Olko [Sat, 2 Aug 2025 14:37:25 +0000 (16:37 +0200)] 
Remove incorrect feature coverage comment from msgfmt script's docstring (#112862)

Remove feature coverage comment from msgfmt script's docstring

msgfmt handles plural forms since cb081b83.

The comment was incorrectly applied in 637a33b -- original patch was from before the cb081b83 commit.

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
3 months agoDoc: remove unused images (#137323)
Inada Naoki [Sat, 2 Aug 2025 14:32:18 +0000 (23:32 +0900)] 
Doc: remove unused images (#137323)

3 months agogh-137308: Replace a single docstring with `pass` in `-OO` mode (#137318)
sobolevn [Sat, 2 Aug 2025 11:57:01 +0000 (14:57 +0300)] 
gh-137308: Replace a single docstring with `pass` in `-OO` mode (#137318)

This is required so we would never have empty node bodies.
Refs #130087

3 months agogh-131876: Revert "gh-131876: extract `_hashlib` helpers into a separate directory...
Bénédikt Tran [Fri, 1 Aug 2025 17:45:40 +0000 (19:45 +0200)] 
gh-131876: Revert "gh-131876: extract `_hashlib` helpers into a separate directory (#136995) (#137307)

Revert "gh-131876: extract `_hashlib` helpers into a separate directory (#136995)"

This reverts commit 45138d35843297395b2d646f5391be108243957a.

3 months agoGH-136410: Faster side exits by using a cold exit stub (GH-136411)
Mark Shannon [Fri, 1 Aug 2025 15:26:07 +0000 (16:26 +0100)] 
GH-136410: Faster side exits by using a cold exit stub (GH-136411)

3 months agogh-137273: Fix debug assertion failure in locale.setlocale() on Windows (GH-137300)
Serhiy Storchaka [Fri, 1 Aug 2025 14:43:53 +0000 (17:43 +0300)] 
gh-137273: Fix debug assertion failure in locale.setlocale() on Windows (GH-137300)

It happened when there were at least 16 characters after dot in the
locale name.

3 months agogh-133467: fix data race in `type_set_name` (#137302)
Kumar Aditya [Fri, 1 Aug 2025 13:40:40 +0000 (19:10 +0530)] 
gh-133467: fix data race in `type_set_name` (#137302)

Fix data race in `type_set_name` by assigning name under stop the world pause making it thread safe in free-threading.

3 months agogh-128813: soft-deprecate _Py_c_*() functions (GH-137261)
Sergey B Kirpichev [Fri, 1 Aug 2025 07:40:12 +0000 (10:40 +0300)] 
gh-128813: soft-deprecate _Py_c_*() functions (GH-137261)

3 months agogh-137282: Fix `TypeError` in tab completion and `dir()` of `concurrent.futures`...
Henry Schreiner [Thu, 31 Jul 2025 16:17:27 +0000 (12:17 -0400)] 
gh-137282: Fix `TypeError` in tab completion and `dir()` of `concurrent.futures` (GH-137214)

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
3 months agogh-137200: support frame lineno setter with `BRANCH_LEFT` and `BRANCH_RIGHT` events...
Xuanteng Huang [Thu, 31 Jul 2025 13:22:22 +0000 (21:22 +0800)] 
gh-137200: support frame lineno setter with `BRANCH_LEFT` and `BRANCH_RIGHT` events (GH-137229)

3 months agogh-131146: Fix month names in a "standalone form" in calendar module (GH-131147)
Dzmitry Plashchynski [Thu, 31 Jul 2025 12:06:33 +0000 (15:06 +0300)] 
gh-131146: Fix month names in a "standalone form" in calendar module (GH-131147)

The calendar module displays month names in some locales using the genitive case.
This is grammatically incorrect, as the nominative case should be used when the month
is named by itself. To address this issue, this change introduces new lists
`standalone_month_name` and `standalone_month_abbr` that contain month names in
the nominative case -- or more generally, in the form that should be used to
name the month itself, rather than form a date.

The module now uses the `%OB` format specifier to get month names in this form
where available.

3 months agogh-137194: Fix requires_debug_ranges when _testcpi doesn't exist (GH-137195)
Jeong, YunWon [Thu, 31 Jul 2025 11:22:11 +0000 (20:22 +0900)] 
gh-137194: Fix requires_debug_ranges when _testcpi doesn't exist (GH-137195)

3 months agogh-124503: Optimize ast.literal_eval() for small input (GH-137010)
Krzysztof Magusiak [Thu, 31 Jul 2025 09:55:00 +0000 (11:55 +0200)] 
gh-124503: Optimize ast.literal_eval() for small input (GH-137010)

The implementation does not create anymore local functions which reduces
the overhead for small inputs. Some other calls are inlined into a
single `_convert_literal` function.
We have a gain of 10-20% for small inputs and only 1-2% for bigger
inputs.

3 months agogh-137025: Include ``python.worker.mjs`` in the Emscripten Web Example (#137236)
adam j hartz [Thu, 31 Jul 2025 08:19:52 +0000 (04:19 -0400)] 
gh-137025: Include ``python.worker.mjs`` in the Emscripten Web Example (#137236)

3 months agogh-119180: Refer to `annotationlib.get_annotations()` in `typing.get_type_hints(...
Victorien [Thu, 31 Jul 2025 03:21:56 +0000 (05:21 +0200)] 
gh-119180: Refer to `annotationlib.get_annotations()` in `typing.get_type_hints()` documentation (#137247)

3 months agoGH-134291: Support older macOS deployment targets for JIT builds (GH-137211)
Brandt Bucher [Wed, 30 Jul 2025 22:48:18 +0000 (15:48 -0700)] 
GH-134291: Support older macOS deployment targets for JIT builds (GH-137211)

3 months agogh-137239: Add *_max functions to heapq.__all__ (gh-137241)
Stan Ulbrych [Wed, 30 Jul 2025 21:12:14 +0000 (23:12 +0200)] 
gh-137239: Add *_max functions to heapq.__all__ (gh-137241)

3 months agoAdd example of min-heap and max-heap working together (gh-137251)
Raymond Hettinger [Wed, 30 Jul 2025 20:53:33 +0000 (15:53 -0500)] 
Add example of min-heap and max-heap working together (gh-137251)

3 months agoGH-137248: Add a `--logdir` option to `Tools/wasm/wasi` (GH-137249)
Brett Cannon [Wed, 30 Jul 2025 19:13:37 +0000 (12:13 -0700)] 
GH-137248: Add a `--logdir` option to `Tools/wasm/wasi` (GH-137249)

3 months agoGH-137243: Have `Tools/wasm/wasi` detect WASI SDK installs in `/opt` when the release...
Brett Cannon [Wed, 30 Jul 2025 18:46:24 +0000 (11:46 -0700)] 
GH-137243: Have `Tools/wasm/wasi` detect WASI SDK installs in `/opt` when the release tarball is extracted (GH-137244)

3 months agogh-135444: fix `asyncio.DatagramTransport.sendto` to account for datagram header...
Justin Bronder [Wed, 30 Jul 2025 18:11:28 +0000 (14:11 -0400)] 
gh-135444: fix `asyncio.DatagramTransport.sendto` to account for datagram header size when data cannot be sent (#135445)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
3 months agogh-71189: Support all-but-last mode in os.path.realpath() (GH-117562)
Serhiy Storchaka [Wed, 30 Jul 2025 07:19:19 +0000 (10:19 +0300)] 
gh-71189: Support all-but-last mode in os.path.realpath() (GH-117562)

3 months agoGH-116738: document thread-safety of bisect (GH-136555)
Neil Schemenauer [Wed, 30 Jul 2025 02:44:10 +0000 (19:44 -0700)] 
GH-116738: document thread-safety of bisect (GH-136555)

3 months agogh-137179: Fix flaky test_history_survive_crash test (gh-137180)
Sam Gross [Tue, 29 Jul 2025 18:25:50 +0000 (14:25 -0400)] 
gh-137179: Fix flaky test_history_survive_crash test (gh-137180)

Kill the REPL subprocess once it prints the output from the command
immediately before the `time.sleep()`.

3 months agogh-137183: Document that `array.array` typecode `w` is new in 3.13 (GH-137184)
Akuli [Tue, 29 Jul 2025 15:23:44 +0000 (18:23 +0300)] 
gh-137183: Document that `array.array` typecode `w` is new in 3.13 (GH-137184)

3 months agogh-137185: Fix `_Py_DumpStack()` async signal safety (gh-137187)
Sam Gross [Tue, 29 Jul 2025 14:25:32 +0000 (10:25 -0400)] 
gh-137185: Fix `_Py_DumpStack()` async signal safety (gh-137187)

Call backtrace() once when installing the signal handler to ensure that
libgcc is dynamically loaded outside the signal handler.

This fixes a "signal-unsafe call inside of a signal" TSan error from
test_faulthandler.test_enable_fd.

3 months agoAdd a What's New entry for Emscripten (#137035)
Hood Chatham [Tue, 29 Jul 2025 00:42:07 +0000 (02:42 +0200)] 
Add a What's New entry for Emscripten (#137035)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
3 months agogh-136843: Document how multiple inheritance works (#136844)
Jelle Zijlstra [Mon, 28 Jul 2025 19:35:40 +0000 (12:35 -0700)] 
gh-136843: Document how multiple inheritance works (#136844)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
3 months agogh-136586: Improve winreg's module docstring (GH-136587)
AN Long [Mon, 28 Jul 2025 19:19:01 +0000 (04:19 +0900)] 
gh-136586: Improve winreg's module docstring (GH-136587)

3 months agogh-136306: Add support for getting and setting SSL groups (#136307)
Ron Frederick [Mon, 28 Jul 2025 17:33:31 +0000 (10:33 -0700)] 
gh-136306: Add support for getting and setting SSL groups (#136307)

Add support for getting and setting groups used for key agreement.

* `ssl.SSLSocket.group()` returns the name of the group used
  for the key agreement of the current session establishment.
  This feature requires Python to be built with OpenSSL 3.2 or later.

* `ssl.SSLContext.get_groups()` returns the list of names of groups
  that are compatible with the TLS version of the current context.
  This feature requires Python to be built with OpenSSL 3.5 or later.

* `ssl.SSLContext.set_groups()` sets the groups allowed for key agreement
  for sockets created with this context. This feature is always supported.

3 months agoGH-131296: Fixes clang-cl warning on Windows in socketmodule.h (GH-131832)
Chris Eibl [Mon, 28 Jul 2025 16:52:07 +0000 (18:52 +0200)] 
GH-131296: Fixes clang-cl warning on Windows in socketmodule.h (GH-131832)

3 months agogh-134043: use stackrefs for dict lookup in `_PyObject_GetMethodStackRef` (#136412)
Kumar Aditya [Mon, 28 Jul 2025 16:34:57 +0000 (22:04 +0530)] 
gh-134043: use stackrefs for dict lookup in `_PyObject_GetMethodStackRef` (#136412)

Co-authored-by: Sam Gross <colesbury@gmail.com>
3 months agogh-131338: Disable computed stack limit checks on non-glibc linux (#134336)
R. David Murray [Mon, 28 Jul 2025 16:32:34 +0000 (12:32 -0400)] 
gh-131338: Disable computed stack limit checks on non-glibc linux (#134336)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
3 months agogh-130577: tarfile now validates archives to ensure member offsets are non-negative...
Alexander Urieles [Mon, 28 Jul 2025 15:37:26 +0000 (17:37 +0200)] 
gh-130577: tarfile now validates archives to ensure member offsets are non-negative (GH-137027)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
3 months agogh-119711: describe `create_datagram_endpoint`'s behavior in asyncio when `local_addr...
AN Long [Mon, 28 Jul 2025 10:55:59 +0000 (19:55 +0900)] 
gh-119711: describe `create_datagram_endpoint`'s behavior in asyncio when `local_addr` is `None` (#136913)

3 months agogh-131876: extract `_hashlib` helpers into a separate directory (#136995)
Bénédikt Tran [Mon, 28 Jul 2025 09:28:48 +0000 (11:28 +0200)] 
gh-131876: extract `_hashlib` helpers into a separate directory (#136995)

The `Modules/hashlib.h` helper file is now removed and split into multiple files:

* `Modules/_hashlib/hashlib_buffer.[ch]` -- Utilities for getting a buffer view and handling buffer inputs.
* `Modules/_hashlib/hashlib_fetch.h` -- Utilities used when fetching a message digest from a digest-like identifier.
  Currently, this file only contains common error messages as the fetching API is not yet implemented.
* `Modules/_hashlib/hashlib_mutex.h` -- Utilities for managing the lock on cryptographic hash objects.

3 months agogh-136968: fortify macro usage in cryptographic modules (#136973)
Bénédikt Tran [Mon, 28 Jul 2025 07:36:15 +0000 (09:36 +0200)] 
gh-136968: fortify macro usage in cryptographic modules (#136973)

Macros used in cryptographic extension modules are partially rewritten
to use `static inline` functions when possible to help code completion.

3 months agogh-132898: Add a note in `multiprocessing.Process` docs about creating a process...
Duprat [Sun, 27 Jul 2025 19:59:08 +0000 (21:59 +0200)] 
gh-132898: Add a note in `multiprocessing.Process` docs about creating a process in a REPL (GH-137118)

* Reword, expand, and clarify the limitation, highlighting the REPL case.
* Mention in the high level Process description.
* added a pointer to the GH issue from the doc note

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
3 months agogh-136278: Document codecs.escape_encode() and codecs.escape_decode() (#136314)
Toshaksha [Sun, 27 Jul 2025 16:37:52 +0000 (22:07 +0530)] 
gh-136278: Document codecs.escape_encode() and codecs.escape_decode() (#136314)

Closes #136278

3 months agoGH-128520: pathlib ABCs: tweak protocol for virtual path strings (#134104)
Barney Gale [Sun, 27 Jul 2025 11:47:15 +0000 (12:47 +0100)] 
GH-128520: pathlib ABCs: tweak protocol for virtual path strings (#134104)

Adjust `pathlib._os.vfspath()` so that it doesn't try `os.fsdecode()`. I
don't know that supporting `os.PathLike` arguments is a good idea, so
it's best to leave it out for now.

3 months agoGH-137059: `url2pathname()`: fix support for drive letter in netloc (#137060)
Barney Gale [Sun, 27 Jul 2025 11:44:41 +0000 (12:44 +0100)] 
GH-137059: `url2pathname()`: fix support for drive letter in netloc (#137060)

Support file URLs like `file://c:/foo` in `urllib.request.url2pathname()`
on Windows. This restores behaviour from 3.13.

3 months agogh-136992: Add "None" as valid `SameSite` value as per RFC 6265bis (#137040)
Iqra Khan [Sun, 27 Jul 2025 08:27:08 +0000 (13:57 +0530)] 
gh-136992: Add "None" as valid `SameSite` value as per RFC 6265bis (#137040)

The "SameSite" attribute defined in RFC 6265bis [1] allows the "Strict", "Lax" and "None"
enforcement modes. We already documented "Strict" and "Lax" as being valid values
but "None" was missing from the list. While the RFC has not been formally approved,
modern browsers support the "None" value [2, 3] thereby making sense to document it.

[1]: https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis
[2]: https://developers.google.com/search/blog/2020/01/get-ready-for-new-samesitenone-secure
[3]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie#none

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
3 months agogh-137058: Update C23 standard version check in `pyport.h` (#137127)
Abdul [Sun, 27 Jul 2025 07:47:21 +0000 (08:47 +0100)] 
gh-137058: Update C23 standard version check in `pyport.h` (#137127)

Use `__STDC_VERSION__ >= 202311L` instead of `__STDC_VERSION__ > 201710L`.

3 months agoLink to plaintext for "show source" links (#137131)
ryan-duve [Sun, 27 Jul 2025 01:48:56 +0000 (21:48 -0400)] 
Link to plaintext for "show source" links (#137131)

3 months agogh-131038: Use text=True in subprocesses in test_perf_profiler (#137117)
Pablo Galindo Salgado [Sat, 26 Jul 2025 17:01:51 +0000 (18:01 +0100)] 
gh-131038: Use text=True in subprocesses in test_perf_profiler (#137117)

3 months agogh-126662: naming consistency for `signal.ItimerError` (#126712)
Stephen Morton [Sat, 26 Jul 2025 16:44:12 +0000 (09:44 -0700)] 
gh-126662: naming consistency for `signal.ItimerError` (#126712)

3 months agogh-136912: fix handling of `OverflowError` in `hmac.digest` (#136917)
Bénédikt Tran [Sat, 26 Jul 2025 08:22:06 +0000 (10:22 +0200)] 
gh-136912: fix handling of `OverflowError` in `hmac.digest` (#136917)

The OpenSSL and HACL* implementations of HMAC single-shot
digest computation reject keys whose length exceeds `INT_MAX`
and `UINT32_MAX` respectively. The OpenSSL implementation
also rejects messages whose length exceed `INT_MAX`.

Using such keys in `hmac.digest` previously raised an `OverflowError`
which was propagated to the caller. This commit mitigates this case by
making `hmac.digest` fall back to HMAC's pure Python implementation
which accepts arbitrary large keys or messages.

This change only affects the top-level entrypoint `hmac.digest`, leaving
`_hashopenssl.hmac_digest` and `_hmac.compute_digest` untouched.

3 months agoGH-132732: Use pure op machinery to optimize `COMPARE_OP_INT/FLOAT/STR` (#137062)
Savannah Bailey [Sat, 26 Jul 2025 02:02:04 +0000 (19:02 -0700)] 
GH-132732: Use pure op machinery to optimize `COMPARE_OP_INT/FLOAT/STR` (#137062)

Co-authored-by: Ken Jin <kenjin4096@gmail.com>
3 months agogh-137090: Remove redundant statement in ``Doc/library/concurrent.interpreters.rst...
soolabettu [Fri, 25 Jul 2025 15:50:53 +0000 (11:50 -0400)] 
gh-137090: Remove redundant statement in ``Doc/library/concurrent.interpreters.rst`` (#137091)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
3 months agogh-134698: Hold a lock when the thread state is detached in `ssl` (GH-134724)
Peter Bierma [Fri, 25 Jul 2025 15:16:05 +0000 (10:16 -0500)] 
gh-134698: Hold a lock when the thread state is detached in `ssl` (GH-134724)

Lock when the thread state is detached.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
3 months agogh-130522: Fix unraisable TypeError in threading at interpreter shutdown (#131537)
Tyler Kennedy [Fri, 25 Jul 2025 14:51:30 +0000 (10:51 -0400)] 
gh-130522: Fix unraisable TypeError in threading at interpreter shutdown (#131537)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
3 months agogh-136929: ensure that `hashlib.<name>` does not raise `AttributeError` (#136933)
Bénédikt Tran [Fri, 25 Jul 2025 14:49:09 +0000 (16:49 +0200)] 
gh-136929: ensure that `hashlib.<name>` does not raise `AttributeError` (#136933)

Previously, if OpenSSL was not present and built-in cryptographic extension modules
were disabled, requesting `hashlib.<name>` raised `AttributeError` and an ERROR log
message with the exception traceback is emitted when importing `hashlib`.

Now, the named constructor function will always be available but raises a `ValueError`
at runtime indicating that the algorithm is not supported. The log message has also
been reworded to be less verbose.

3 months agoFix Queue.shutdown docs for condition to unblock a join (gh-137088)
Raymond Hettinger [Fri, 25 Jul 2025 13:56:28 +0000 (07:56 -0600)] 
Fix Queue.shutdown docs for condition to unblock a join (gh-137088)

3 months agogh-137084: remove multiple calls to `get_gc_state` in `gc.c` (#137085)
Sergey Miryanov [Fri, 25 Jul 2025 12:43:54 +0000 (05:43 -0700)] 
gh-137084: remove multiple calls to `get_gc_state` in `gc.c` (#137085)

3 months agogh-137093: Fix race condition in `test_embed.test_bpo20891` (GH-137094)
Peter Bierma [Fri, 25 Jul 2025 12:33:18 +0000 (07:33 -0500)] 
gh-137093: Fix race condition in `test_embed.test_bpo20891` (GH-137094)

Use a `PyEvent` instead of a lock to fix a race on the free-threaded build.

3 months agogh-136914: Fix support of cached functions and properties in DocTest's lineno computa...
Denis Laxalde [Fri, 25 Jul 2025 09:46:12 +0000 (11:46 +0200)] 
gh-136914: Fix support of cached functions and properties in DocTest's lineno computation (GH-136930)

Previously, DocTest's lineno of functions and methods decorated with
functools.cache(), functools.lru_cache() and functools.cached_property()
was not properly returned (None was returned) because the
computation relied on inspect.isfunction() which does not consider the
decorated result as a function.

We now use the more generic inspect.isroutine(), as elsewhere
in doctest's logic.

Also, added a special case for functools.cached_property().

3 months agoExclude _testclinic_depr.c.h from c-analyzer (GH-137086)
Zachary Ware [Thu, 24 Jul 2025 20:50:01 +0000 (15:50 -0500)] 
Exclude _testclinic_depr.c.h from c-analyzer (GH-137086)

_testclinic.c mocks out PY_VERSION_HEX to 3.8 before including
_testclinic_depr.c.h to avoid the errors the preprocessor would
otherwise throw due to the deprecation feature it is testing.

Also partially revert 74e2acddf68b31ce16e8e0067b1df8c7b67bd6c8:
this restores Modules/_testclinic.c to match the same file in the 3.14
branch.

3 months agogh-136870: fix data races in instrumentation of bytecode (#136994)
Kumar Aditya [Thu, 24 Jul 2025 17:58:46 +0000 (23:28 +0530)] 
gh-136870: fix data races in instrumentation of bytecode (#136994)

De-instrumenting code objects modifies the thread local bytecode for all threads as such, holding the critical section on the code object is not sufficient and leads to data races. Now, the de-instrumentation is now performed under a stop the world pause as such no thread races with executing the thread local bytecode while it is being de-instrumented.

3 months agoFix docs for Queue.shutdown (gh-137028)
Raymond Hettinger [Thu, 24 Jul 2025 17:23:03 +0000 (11:23 -0600)] 
Fix docs for Queue.shutdown (gh-137028)

3 months agogh-132551: add missing critical sections on BytesIO methods (#137073)
Kumar Aditya [Thu, 24 Jul 2025 11:57:48 +0000 (17:27 +0530)] 
gh-132551: add missing critical sections on BytesIO methods (#137073)

3 months agogh-137054: remove obsolete counting of objects in young generation under `Py_STATS...
Sergey Miryanov [Thu, 24 Jul 2025 11:30:27 +0000 (04:30 -0700)] 
gh-137054: remove obsolete counting of objects in young generation under `Py_STATS` builds (#137055)

3 months agogh-136759: rename `lock.h` to `pylock.h` (#137041)
AN Long [Thu, 24 Jul 2025 10:46:07 +0000 (19:46 +0900)] 
gh-136759: rename `lock.h` to `pylock.h` (#137041)

Rename `lock.h` to `pylock.h` to avoid conflicts with headers of other projects.

3 months agogh-124621: Emscripten: Add smoke test for using pyrepl in Chrome (#137004)
Hood Chatham [Thu, 24 Jul 2025 06:44:02 +0000 (08:44 +0200)] 
gh-124621: Emscripten: Add smoke test for using pyrepl in Chrome (#137004)

Adds a mechanism to test browser-based initialisation of the Python interpreter,
via a Playwright headless browser instance.

3 months agogh-136976: Emscripten: Add _decimal and libmpdec (#136997)
Hood Chatham [Thu, 24 Jul 2025 06:31:30 +0000 (08:31 +0200)] 
gh-136976: Emscripten: Add _decimal and libmpdec (#136997)

Adds tooling to build mpdec (and thus _decimal) as part of an Emscripten build.

3 months agogh-136980: Remove unused C tracing code in bdb (#136981)
FredericDT [Thu, 24 Jul 2025 00:58:54 +0000 (08:58 +0800)] 
gh-136980: Remove unused C tracing code in bdb (#136981)

3 months agoTouch up `Setup.local` handling in `Tools/wasm/wasi` (GH-137051)
Brett Cannon [Wed, 23 Jul 2025 18:50:15 +0000 (11:50 -0700)] 
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.

3 months agogh-132983: Add missing references to Zstandard in shutil docstrings (GH-136617)
Rogdham [Wed, 23 Jul 2025 18:09:53 +0000 (20:09 +0200)] 
gh-132983: Add missing references to Zstandard in shutil docstrings (GH-136617)

Zstd references in shutil docstrings

3 months agogh-135676: Lexical analysis: Reword String literals and related sections (GH-135942)
Petr Viktorin [Wed, 23 Jul 2025 15:57:54 +0000 (17:57 +0200)] 
gh-135676: Lexical analysis: Reword String literals and related sections (GH-135942)

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
3 months agoRevert "gh-135228: When @dataclass(slots=True) replaces a dataclass, make the origina...
Jelle Zijlstra [Wed, 23 Jul 2025 15:13:19 +0000 (08:13 -0700)] 
Revert "gh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class collectible (#136893)" (#137014)

This reverts commit 46cbdf967ada11b0286060488b61635fd6a2bb23.

3 months agogh-137043: mention `PyList_GET_ITEM` as unsafe borrowed API in free-threading docs...
Guido Imperiale [Wed, 23 Jul 2025 14:36:06 +0000 (15:36 +0100)] 
gh-137043: mention `PyList_GET_ITEM` as unsafe borrowed API in free-threading docs (#137042)

3 months agoFix typos in Doc/extending/extending.rst and Doc/library/shelve.rst (GH-136890)
Cornelius Roemer [Wed, 23 Jul 2025 12:04:59 +0000 (14:04 +0200)] 
Fix typos in Doc/extending/extending.rst and Doc/library/shelve.rst (GH-136890)

3 months agogh-136516: Mention installation artifacts as de-facto resources (GH-136419)
Petr Viktorin [Wed, 23 Jul 2025 12:01:38 +0000 (14:01 +0200)] 
gh-136516: Mention installation artifacts as de-facto resources (GH-136419)

Files like NUL on windows are, from `importlib.resources` point of
view, an artifact caused by installing to a filesystem directory.
Mention these.

3 months agogh-136437: Make several functions in `os.path` pos-only (#136949)
sobolevn [Wed, 23 Jul 2025 11:56:02 +0000 (14:56 +0300)] 
gh-136437: Make several functions in `os.path` pos-only (#136949)

3 months agogh-136459: Use platform-specific type in perf_jit_trampoline (GH-137031)
Petr Viktorin [Wed, 23 Jul 2025 08:20:42 +0000 (10:20 +0200)] 
gh-136459: Use platform-specific type in perf_jit_trampoline (GH-137031)

gh-136461 added perf support for macOS, with ifdefs around all changes
except increasing thread_id to 64 bits.
Make that change Apple-specific too.

3 months agogh-133296: Fix versionadded for C API functions that were backported (#137024)
Nathan Goldbaum [Tue, 22 Jul 2025 20:27:50 +0000 (14:27 -0600)] 
gh-133296: Fix versionadded for C API functions that were backported (#137024)

3 months agoUse `test.support.is_wasm32` flag for `is_emscripten` or `is_wasi` for generic checks...
Ani [Tue, 22 Jul 2025 19:50:13 +0000 (01:20 +0530)] 
Use `test.support.is_wasm32` flag for `is_emscripten` or `is_wasi` for generic checks (GH-136815)

Co-authored-by: Brett Cannon <brett@python.org>
3 months agoFix tables in 'Using on Windows' for the text writer (#137012)
Adam Turner [Tue, 22 Jul 2025 16:15:29 +0000 (18:15 +0200)] 
Fix tables in 'Using on Windows' for the text writer (#137012)

3 months agogh-136459: Add perf trampoline support for macOS (#136461)
Nazım Can Altınova [Tue, 22 Jul 2025 15:47:24 +0000 (17:47 +0200)] 
gh-136459: Add perf trampoline support for macOS  (#136461)

3 months agoGH-136975: Emend a spelling error (algorthm -> algorithm) (#136999)
Adam Turner [Tue, 22 Jul 2025 13:48:58 +0000 (15:48 +0200)] 
GH-136975: Emend a spelling error (algorthm -> algorithm) (#136999)

3 months agoFix code example in `annotationlib` documentation (#136972)
Victorien [Tue, 22 Jul 2025 13:48:02 +0000 (15:48 +0200)] 
Fix code example in `annotationlib` documentation (#136972)

3 months agoRevert "gh-112068: C API: Add support of nullable arguments in PyArg_Parse (GH-121303...
Serhiy Storchaka [Tue, 22 Jul 2025 13:39:50 +0000 (16:39 +0300)] 
Revert "gh-112068: C API: Add support of nullable arguments in PyArg_Parse (GH-121303)" (#136991)

3 months agogh-136437: Convert more ``os.path`` functions to positional-only in the docs (#136970)
sobolevn [Tue, 22 Jul 2025 13:38:33 +0000 (16:38 +0300)] 
gh-136437: Convert more ``os.path`` functions to positional-only in the docs (#136970)

3 months agogh-124621: Emscripten: Fix __syscall_ioctl patch (GH-136993)
Hood Chatham [Tue, 22 Jul 2025 13:05:26 +0000 (15:05 +0200)] 
gh-124621: Emscripten: Fix __syscall_ioctl patch (GH-136993)

If there is an error, we have to return `-errno` not positive errno.
Included in backport of GH-136931: #136988

3 months agogh-133742: Fix test_sysconfig and test_build_details for relocated directories (...
Pablo Galindo Salgado [Tue, 22 Jul 2025 11:53:05 +0000 (13:53 +0200)] 
gh-133742: Fix test_sysconfig and test_build_details for relocated directories (#136987)

3 months agogh-118350: Fix support of elements "textarea" and "title" in HTMLParser (#135310)
Timon Viola [Tue, 22 Jul 2025 11:27:13 +0000 (13:27 +0200)] 
gh-118350: Fix support of elements "textarea" and "title" in HTMLParser (#135310)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
3 months agogh-124621: Emscripten: Support pyrepl in browser (GH-136931)
Hood Chatham [Tue, 22 Jul 2025 10:13:38 +0000 (12:13 +0200)] 
gh-124621: Emscripten: Support pyrepl in browser (GH-136931)

Basic support for pyrepl in Emscripten. Limitations:
* requires JSPI
* no signal handling implemented

As followup work, it would be nice to implement a webworker variant
for when JSPI is not available and proper signal handling.

Because it requires JSPI, it doesn't work in Safari. Firefox requires
setting an experimental flag. All the Chromiums have full support since
May. Until we make it work without JSPI, let's keep the original web_example
around.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Éric <merwok@netwok.org>
3 months agogh-132661: Document t-strings and `templatelib` (#135229)
Dave Peck [Tue, 22 Jul 2025 09:44:13 +0000 (02:44 -0700)] 
gh-132661: Document t-strings and `templatelib` (#135229)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Loïc Simon <loic.pano@gmail.com>
Co-authored-by: pauleveritt <pauleveritt@me.com>
3 months agoFix 3 typos in "Next" News items (#136892)
Cornelius Roemer [Tue, 22 Jul 2025 08:22:08 +0000 (10:22 +0200)] 
Fix 3 typos in "Next" News items (#136892)

3 months agogh-131531: Android test fixes (#136845)
Malcolm Smith [Tue, 22 Jul 2025 06:51:16 +0000 (07:51 +0100)] 
gh-131531: Android test fixes (#136845)

Modifies the test runner script to no longer export the the HOST environment
variable, and to allow for tests that produce no Python output (output from the
Android console is still expected and required). These changes stem from
knowledge gained during developing a PR for Android support in cibuildwheel.

3 months agogh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class...
Jelle Zijlstra [Tue, 22 Jul 2025 04:43:34 +0000 (21:43 -0700)] 
gh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class collectible (#136893)

An interesting hack, but more localized in scope than #135230.

This may be a breaking change if people intentionally keep the original class around
when using `@dataclass(slots=True)`, and then use `__dict__` or `__weakref__` on the
original class.

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
3 months agogh-133600: Move config.site-wasm32-emscripten into the emscripten folder (#136934)
Hood Chatham [Mon, 21 Jul 2025 23:58:31 +0000 (01:58 +0200)] 
gh-133600: Move config.site-wasm32-emscripten into the emscripten folder (#136934)

Reorganises the large Emscripten-specific file into the Emscripten folder.

3 months agogh-136170: Revert adding `ZipFile.data_offset` (GH-136950)
Emma Smith [Mon, 21 Jul 2025 23:16:30 +0000 (16:16 -0700)] 
gh-136170: Revert adding `ZipFile.data_offset` (GH-136950)

* Revert "gh-84481: Make ZipFile.data_offset more robust (#132178)"

This reverts commit 6cd1d6c6b142697fb72f422b7b448c27ebc30534.

* Revert "gh-84481: Add ZipFile.data_offset attribute (#132165)"

This reverts commit 0788948dcb980c7648b29ca363390b696d7f188f.

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
3 months agogh-133296: Publicly expose critical section API that accepts PyMutex (gh-135899)
Nathan Goldbaum [Mon, 21 Jul 2025 21:25:43 +0000 (15:25 -0600)] 
gh-133296: Publicly expose critical section API that accepts PyMutex (gh-135899)

This makes the following APIs public:

* `Py_BEGIN_CRITICAL_SECTION_MUTEX(mutex),`
* `Py_BEGIN_CRITICAL_SECTION2_MUTEX(mutex1, mutex2)`
* `void PyCriticalSection_BeginMutex(PyCriticalSection *c, PyMutex *mutex)`
* `void PyCriticalSection2_BeginMutex(PyCriticalSection2 *c, PyMutex *mutex1, PyMutex *mutex2)`

The macros are identical to the corresponding `Py_BEGIN_CRITICAL_SECTION` and
`Py_BEGIN_CRITICAL_SECTION2` macros (e.g., they include braces), but they
accept a `PyMutex` instead of an object.

The new macros are still paired with the existing END macros
(`Py_END_CRITICAL_SECTION`, `Py_END_CRITICAL_SECTION2`).

3 months agogh-136870: fix data race in `PyThreadState_Clear` on `sys_tracing_threads` (#136951)
Kumar Aditya [Mon, 21 Jul 2025 20:35:25 +0000 (02:05 +0530)] 
gh-136870: fix data race in `PyThreadState_Clear` on `sys_tracing_threads` (#136951)

In free-threading, multiple threads can be cleared concurrently as such the modifications on `sys_tracing_threads` should be done while holding the profile lock, otherwise it can race with other threads setting up profiling.

3 months agogh-136437: Document `os.path.dirname` as accepting only pos-only (#136946)
sobolevn [Mon, 21 Jul 2025 18:22:58 +0000 (21:22 +0300)] 
gh-136437: Document `os.path.dirname` as accepting only pos-only (#136946)

3 months agogh-136437: Document some `os.path` functions as requiring pos-only (#136812)
sobolevn [Mon, 21 Jul 2025 18:01:43 +0000 (21:01 +0300)] 
gh-136437: Document some `os.path` functions as requiring pos-only (#136812)