]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 months agogh-139330: Check expat version/checksum in SBOM with refresh.sh
Seth Michael Larson [Thu, 25 Sep 2025 17:13:45 +0000 (17:13 +0000)] 
gh-139330: Check expat version/checksum in SBOM with refresh.sh

Check expat version/checksum in SBOM with refresh.sh

2 months agogh-138122: Allow to filter by thread in tachyon's flamegraph (#139216)
Pablo Galindo Salgado [Thu, 25 Sep 2025 14:34:57 +0000 (15:34 +0100)] 
gh-138122: Allow to filter by thread in tachyon's flamegraph (#139216)

2 months agogh-138772: Add tests for Turtle.dot() signature (GH-138773)
Jan-Eric Nitschke [Thu, 25 Sep 2025 13:46:12 +0000 (15:46 +0200)] 
gh-138772: Add tests for Turtle.dot() signature (GH-138773)

2 months agogh-139156: Optimize _PyUnicode_EncodeCharmap() (#139306)
Victor Stinner [Thu, 25 Sep 2025 09:42:16 +0000 (11:42 +0200)] 
gh-139156: Optimize _PyUnicode_EncodeCharmap() (#139306)

Specialize _PyUnicode_EncodeCharmap() for EncodingMapType which is
used by Python codecs such as iso8859_15.

2 months agogh-139275: Fix compilation of Modules/_remote_debugging_module.c when the system...
Pablo Galindo Salgado [Wed, 24 Sep 2025 23:16:44 +0000 (00:16 +0100)] 
gh-139275: Fix compilation of Modules/_remote_debugging_module.c when the system doesn't have process_vm_readv (#139307)

2 months agogh-133059: Increase the small positive integer cache to 1024 (GH-133160)
dgpb [Wed, 24 Sep 2025 21:05:30 +0000 (00:05 +0300)] 
gh-133059: Increase the small positive integer cache to 1024 (GH-133160)

2 months agogh-139292: avoid extra tailing blank line in `python -m inspect -d <target>` (#139293)
yihong [Wed, 24 Sep 2025 18:52:11 +0000 (02:52 +0800)] 
gh-139292: avoid extra tailing blank line in `python -m inspect -d <target>` (#139293)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
2 months agogh-139156: Optimize the UTF-7 encoder (#139253)
Victor Stinner [Wed, 24 Sep 2025 15:57:29 +0000 (17:57 +0200)] 
gh-139156: Optimize the UTF-7 encoder (#139253)

Remove base64SetO and base64WhiteSpace parameters.

2 months agogh-139156: Use PyBytesWriter in PyUnicode_EncodeCodePage() (#139259)
Victor Stinner [Wed, 24 Sep 2025 14:39:40 +0000 (16:39 +0200)] 
gh-139156: Use PyBytesWriter in PyUnicode_EncodeCodePage() (#139259)

Replace PyBytes_FromStringAndSize() and _PyBytes_Resize() with the
PyBytesWriter API.

2 months agogh-139156: Use PyBytesWriter in _PyUnicode_EncodeCharmap() (#139251)
Victor Stinner [Wed, 24 Sep 2025 14:15:34 +0000 (16:15 +0200)] 
gh-139156: Use PyBytesWriter in _PyUnicode_EncodeCharmap() (#139251)

Replace PyBytes_FromStringAndSize() and _PyBytes_Resize() with the
PyBytesWriter API.

Add _PyBytesWriter_GetSize() and _PyBytesWriter_GetData() static
inline functions.

2 months agoRemove `.. deprecated-removed` notes for `typing.{NamedTuple, TypedDict}` (#139298)
sobolevn [Wed, 24 Sep 2025 13:24:58 +0000 (16:24 +0300)] 
Remove `.. deprecated-removed` notes for `typing.{NamedTuple, TypedDict}` (#139298)

2 months agogh-139231: Fix estimation of available stack size for recursion limit on macOS (GH...
Rok Mandeljc [Wed, 24 Sep 2025 10:57:00 +0000 (12:57 +0200)] 
gh-139231: Fix estimation of available stack size for recursion limit on macOS (GH-139232)

Use `pthread_get_stackaddr_np()` and `pthread_get_stacksize_np()` to determine the stack address and size.

2 months agogh-133644: remove `PyWeakref_GetObject` and `PyWeakref_GET_OBJECT` (GH-133657)
Bénédikt Tran [Wed, 24 Sep 2025 09:25:56 +0000 (11:25 +0200)] 
gh-133644: remove `PyWeakref_GetObject` and `PyWeakref_GET_OBJECT` (GH-133657)

2 months agogh-83336: Add alias for consistency to `utf-8-sig` (#136530)
Stan Ulbrych [Wed, 24 Sep 2025 08:38:57 +0000 (09:38 +0100)] 
gh-83336: Add alias for consistency to `utf-8-sig` (#136530)

Closes #83336

2 months agogh-133171: Re-enable JUMP_BACKWARD to free-threading build (gh-137800)
Donghee Na [Wed, 24 Sep 2025 05:19:17 +0000 (14:19 +0900)] 
gh-133171: Re-enable JUMP_BACKWARD to free-threading build (gh-137800)

2 months agogh-138860: Lazy import rlcompleter in pdb to avoid deadlock in subprocess (#139185)
Tian Gao [Wed, 24 Sep 2025 03:46:05 +0000 (05:46 +0200)] 
gh-138860: Lazy import rlcompleter in pdb to avoid deadlock in subprocess (#139185)

2 months agoGH-139174: Prepare `pathlib.Path.info` for new methods (#139175)
Barney Gale [Wed, 24 Sep 2025 01:52:24 +0000 (02:52 +0100)] 
GH-139174: Prepare `pathlib.Path.info` for new methods (#139175)

Merge `_WindowsPathInfo` and `_PosixPathInfo` classes into a new
`_StatResultInfo` class. On Windows, this means relying on `os.stat()`
rather than `os.path.isfile()` and friends, which is a little slower. But
there's value in making the code easier to maintain, and we're going to
need the stat result for implementing `size()`, `mode()` etc.

Also move the classes from `pathlib._os` to `pathlib` proper.

2 months agogh-67795: Accept any real numbers as timestamp and timeout (GH-139224)
Serhiy Storchaka [Tue, 23 Sep 2025 18:31:42 +0000 (21:31 +0300)] 
gh-67795: Accept any real numbers as timestamp and timeout (GH-139224)

Functions that take timestamp or timeout arguments now accept any
real numbers (such as Decimal and Fraction), not only integers or floats,
although this does not improve precision.

2 months agogh-138558: Improve handling of Template annotations in annotationlib (#139072)
Dave Peck [Tue, 23 Sep 2025 18:25:51 +0000 (11:25 -0700)] 
gh-138558: Improve handling of Template annotations in annotationlib (#139072)

2 months agogh-74857, PEP 538: Coerce POSIX locale to UTF-8 based locale (#139238)
Victor Stinner [Tue, 23 Sep 2025 17:20:59 +0000 (19:20 +0200)] 
gh-74857, PEP 538: Coerce POSIX locale to UTF-8 based locale (#139238)

2 months agogh-136744: Remove a redundant test skip (#139267)
Russell Keith-Magee [Tue, 23 Sep 2025 16:56:14 +0000 (17:56 +0100)] 
gh-136744: Remove a redundant test skip (#139267)

Remove a redundant test skip.

2 months agogh-129813, PEP 782: Remove the private _PyBytesWriter API (#139264)
Victor Stinner [Tue, 23 Sep 2025 15:29:55 +0000 (17:29 +0200)] 
gh-129813, PEP 782: Remove the private _PyBytesWriter API (#139264)

It is now replaced with the new public PyBytesWriter API (PEP 782).

2 months agogh-130567: Fix possible crash in locale.strxfrm() (GH-138940)
Serhiy Storchaka [Tue, 23 Sep 2025 15:11:50 +0000 (18:11 +0300)] 
gh-130567: Fix possible crash in locale.strxfrm() (GH-138940)

On some macOS versions there was an off-by-one error in wcsxfrm() which
caused writing past the end of the array if its size was not calculated
by running wcsxfrm() first.

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2 months agogh-126016: Fix flaky test by allowing the SIGINT return code (GH-139219)
Peter Bierma [Tue, 23 Sep 2025 14:09:19 +0000 (10:09 -0400)] 
gh-126016: Fix flaky test by allowing the SIGINT return code (GH-139219)

2 months agogh-139208: Fix regrtest --fast-ci --verbose (#139240)
Victor Stinner [Tue, 23 Sep 2025 14:09:01 +0000 (16:09 +0200)] 
gh-139208: Fix regrtest --fast-ci --verbose (#139240)

Don't ignore the --verbose option anymore.

2 months agoGH-137573: Add test to check that the margin used for overflow protection is larger...
Mark Shannon [Tue, 23 Sep 2025 13:47:27 +0000 (14:47 +0100)] 
GH-137573: Add test to check that the margin used for overflow protection is larger than the stack space used by the interpreter (GH-137724)

2 months agogh-129813, PEP 782: Use PyBytesWriter in utf8_encoder() (#138874)
Victor Stinner [Tue, 23 Sep 2025 09:47:09 +0000 (11:47 +0200)] 
gh-129813, PEP 782: Use PyBytesWriter in utf8_encoder() (#138874)

Replace the private _PyBytesWriter API with the new public
PyBytesWriter API in utf8_encoder() and unicode_encode_ucs1().

2 months agogh-139156: Use PyBytesWriter in PyUnicode_AsRawUnicodeEscapeString() (#139250)
Victor Stinner [Mon, 22 Sep 2025 21:46:19 +0000 (23:46 +0200)] 
gh-139156: Use PyBytesWriter in PyUnicode_AsRawUnicodeEscapeString() (#139250)

Replace PyBytes_FromStringAndSize() and _PyBytes_Resize() with the
PyBytesWriter API.

2 months agogh-139156: Use PyBytesWriter in UTF-16 encoder (#139233)
Victor Stinner [Mon, 22 Sep 2025 21:36:05 +0000 (23:36 +0200)] 
gh-139156: Use PyBytesWriter in UTF-16 encoder (#139233)

Replace PyBytes_FromStringAndSize() and _PyBytes_Resize() with the
PyBytesWriter API.

2 months agogh-139156: Use PyBytesWriter in PyUnicode_AsUnicodeEscapeString() (#139249)
Victor Stinner [Mon, 22 Sep 2025 21:22:27 +0000 (23:22 +0200)] 
gh-139156: Use PyBytesWriter in PyUnicode_AsUnicodeEscapeString() (#139249)

Replace PyBytes_FromStringAndSize() and _PyBytes_Resize() with the
PyBytesWriter API.

2 months agogh-139156: Use PyBytesWriter in the UTF-7 encoder (#139248)
Victor Stinner [Mon, 22 Sep 2025 20:49:25 +0000 (22:49 +0200)] 
gh-139156: Use PyBytesWriter in the UTF-7 encoder (#139248)

Replace PyBytes_FromStringAndSize() and _PyBytes_Resize() with the
PyBytesWriter API.

2 months agogh-139156: Use PyBytesWriter in UTF-32 encoder (#139157)
Victor Stinner [Mon, 22 Sep 2025 20:05:35 +0000 (22:05 +0200)] 
gh-139156: Use PyBytesWriter in UTF-32 encoder (#139157)

Replace PyBytes_FromStringAndSize() and _PyBytes_Resize() with the
PyBytesWriter API.

2 months agoGH-139040: Add Dev Container instructions in JIT README (#139041)
Savannah Bailey [Mon, 22 Sep 2025 16:34:02 +0000 (17:34 +0100)] 
GH-139040: Add Dev Container instructions in JIT README (#139041)

2 months agogh-136744: Remove unnecessary chmod from pydoc.apropos() test. (GH-136746)
Russell Keith-Magee [Mon, 22 Sep 2025 14:26:13 +0000 (15:26 +0100)] 
gh-136744: Remove unnecessary chmod from pydoc.apropos() test. (GH-136746)

Remove unnecessary chmod from pydoc.apropos() test.

2 months agogh-95953: Add a css class to changed lines of difflib.HtmlDiff make_table (#139226)
Katie Gardner [Mon, 22 Sep 2025 13:19:37 +0000 (14:19 +0100)] 
gh-95953: Add a css class to changed lines of difflib.HtmlDiff make_table (#139226)

2 months agoGH-137218: Fix Makefile to handle FreeBSD (fix for JIT stencil changes) (GH-139170)
Savannah Bailey [Mon, 22 Sep 2025 12:21:57 +0000 (13:21 +0100)] 
GH-137218: Fix Makefile to handle FreeBSD (fix for JIT stencil changes) (GH-139170)

2 months ago`Doc/library/zoneinfo.rst`: Fix typo (#139190)
Stan Ulbrych [Mon, 22 Sep 2025 11:25:39 +0000 (12:25 +0100)] 
`Doc/library/zoneinfo.rst`: Fix typo (#139190)

Removes duplicated wording.

2 months agogh-136003: Close file descriptors in test (GH-139225)
Petr Viktorin [Mon, 22 Sep 2025 11:22:27 +0000 (13:22 +0200)] 
gh-136003: Close file descriptors in test (GH-139225)

This fixes file descriptor leaks introduced in GH-136004

2 months agogh-138313: Suppress ResourceWarnings and restore skipped test (#138597)
Jason R. Coombs [Mon, 22 Sep 2025 00:53:57 +0000 (20:53 -0400)] 
gh-138313: Suppress ResourceWarnings and restore skipped test (#138597)

2 months ago`Doc/library/os.rst`: Remove spurious parenthesis (GH-139205)
Stan Ulbrych [Sun, 21 Sep 2025 18:57:13 +0000 (19:57 +0100)] 
`Doc/library/os.rst`: Remove spurious parenthesis (GH-139205)

2 months agogh-138709: Supress stdout/stderr during test_sampling_profiler tests (#139212)
Pablo Galindo Salgado [Sun, 21 Sep 2025 18:39:07 +0000 (19:39 +0100)] 
gh-138709: Supress stdout/stderr during test_sampling_profiler tests (#139212)

2 months agogh-138709: Fix race condition in test_external_inspection (#139209)
Pablo Galindo Salgado [Sun, 21 Sep 2025 17:32:03 +0000 (18:32 +0100)] 
gh-138709: Fix race condition in test_external_inspection (#139209)

Fix race condition in test_external_inspection thread status tests

The tests test_thread_status_detection and test_thread_status_gil_detection
had a race condition where the test could sample thread status between when
the sleeper thread sends its "ready" message and when it actually calls
time.sleep(). This caused intermittent test failures where the sleeper
thread would show as running (status=0) instead of idle (status=1 or 2).

The fix moves the thread status collection inside the retry loop and
specifically waits for the expected thread states before proceeding with
assertions. The retry loop now continues until:
- The sleeper thread shows as idle (status=1 for CPU mode, status=2 for GIL mode)
- The busy thread shows as running (status=0)
- Both thread IDs are found in the status collection

This ensures the test waits for threads to settle into their expected states
before making assertions, eliminating the race condition.

2 months agoDocs: add missing tools to `Tools/README` (#139150)
sobolevn [Sun, 21 Sep 2025 11:44:17 +0000 (14:44 +0300)] 
Docs: add missing tools to `Tools/README` (#139150)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 months agogh-138092: Correct the documented signature of ``mmap.flush`` (#138671)
AN Long [Sun, 21 Sep 2025 10:54:30 +0000 (19:54 +0900)] 
gh-138092: Correct the documented signature of ``mmap.flush`` (#138671)

2 months agoMake sure the ``:keyword:`` role works for ``case`` (#138878)
sobolevn [Sun, 21 Sep 2025 10:49:49 +0000 (13:49 +0300)] 
Make sure the ``:keyword:`` role works for ``case`` (#138878)

2 months agoLink to Discourse in ``.github/CONTRIBUTING.rst`` (#138996)
Stan Ulbrych [Sun, 21 Sep 2025 10:49:46 +0000 (11:49 +0100)] 
Link to Discourse in ``.github/CONTRIBUTING.rst`` (#138996)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 months agoRevert "gh-66234: Add flag to disable the use of mmap in dbm.gnu (GH-135005)" (GH...
Serhiy Storchaka [Sat, 20 Sep 2025 08:01:44 +0000 (11:01 +0300)] 
Revert "gh-66234: Add flag to disable the use of mmap in dbm.gnu (GH-135005)" (GH-136989)

This reverts commit 0cec424af5904b3d23ad6e3c6d1a27f89d238d64.

2 months agogh-138013: Split SignalsTest from test_io.test_general (#139079)
Cody Maloney [Fri, 19 Sep 2025 18:21:50 +0000 (11:21 -0700)] 
gh-138013: Split SignalsTest from test_io.test_general (#139079)

Increase parallelism by splitting out `SignalsTest` from test_general.
`SignalsTest` takes 24.2 seconds on my dev machine when fully enabled
making it the largest part of `test_io`. Code move done via copy/paste
then tweak imports.

After splitting `test_io.test_general` is down to 10.1 seconds on my dev
box with all parts enabled.

2 months agogh-138709: Implement CPU time profiling in profiling.sample (#138710)
Pablo Galindo Salgado [Fri, 19 Sep 2025 18:17:28 +0000 (19:17 +0100)] 
gh-138709: Implement CPU time profiling in profiling.sample (#138710)

2 months agogh-112729: Correctly fail when the process is out of memory during interpreter creati...
Peter Bierma [Fri, 19 Sep 2025 14:41:09 +0000 (10:41 -0400)] 
gh-112729: Correctly fail when the process is out of memory during interpreter creation (GH-139164)

2 months agogh-138310: Adds sys.audit event for import_module (#138311)
Lisa Roach [Fri, 19 Sep 2025 13:21:42 +0000 (06:21 -0700)] 
gh-138310: Adds sys.audit event for import_module (#138311)

* Updates sys.audit calls for imports to include import_module
* Adds unit tests for existing and new functionality

2 months agogh-139076: Fix regression in pydoc not showing extension functions (GH-139077)
Serhiy Storchaka [Fri, 19 Sep 2025 12:54:06 +0000 (15:54 +0300)] 
gh-139076: Fix regression in pydoc not showing extension functions (GH-139077)

Fix a bug in the pydoc module that was hiding functions in a Python
module if they were implemented in an extension module and the module did
not have __all__.

2 months agoFix the reference to unicode specification (#139138)
Karolina Surma [Fri, 19 Sep 2025 12:28:55 +0000 (14:28 +0200)] 
Fix the reference to unicode specification (#139138)

2 months agogh-138171: Migrate iOS testbed location and add Apple build script (#138176)
Russell Keith-Magee [Fri, 19 Sep 2025 12:23:38 +0000 (13:23 +0100)] 
gh-138171: Migrate iOS testbed location and add Apple build script (#138176)

Adds tooling to generate and test an iOS XCframework, in a way that will also facilitate
adding other XCframework targets for other Apple platforms (tvOS, watchOS, visionOS and
even macOS, potentially).

---------
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 months agogh-126016: Remove bad assertion in `PyThreadState_Clear` (GH-139158)
Peter Bierma [Fri, 19 Sep 2025 12:17:05 +0000 (08:17 -0400)] 
gh-126016: Remove bad assertion in `PyThreadState_Clear` (GH-139158)

In the _interpreters module, we use PyEval_EvalCode() to run Python code in another interpreter. However, when the process receives a KeyboardInterrupt, PyEval_EvalCode() will jump straight to finalization rather than returning. This prevents us from cleaning up and marking the thread as "not running main", which triggers an assertion in PyThreadState_Clear() on debug builds. Since everything else works as intended, remove that assertion.

2 months agogh-81148: Eliminate unnecessary check in _strptime when determining AM/PM (#13428)
Gordon P. Hemsley [Fri, 19 Sep 2025 10:23:12 +0000 (06:23 -0400)] 
gh-81148: Eliminate unnecessary check in _strptime when determining AM/PM (#13428)

* bpo-36967: Eliminate unnecessary check in _strptime when determining AM/PM

* Pauls suggestion to refactor test

* Fix test

---------

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
2 months agoGH-137218: Update `make` for JIT stencils (#137265)
Savannah Bailey [Fri, 19 Sep 2025 09:36:42 +0000 (10:36 +0100)] 
GH-137218: Update `make` for JIT stencils (#137265)

2 months agogh-129813, PEP 782: Fix refleak in sock_recvfrom() (GH-139151)
Victor Stinner [Fri, 19 Sep 2025 09:30:11 +0000 (10:30 +0100)] 
gh-129813, PEP 782: Fix refleak in sock_recvfrom() (GH-139151)

2 months agogh-121237: Add `%:z` directive to datetime.strptime (#136961)
Semyon Moroz [Fri, 19 Sep 2025 09:25:31 +0000 (13:25 +0400)] 
gh-121237: Add `%:z` directive to datetime.strptime (#136961)

2 months agogh-119494: Fix error messages for deleting/setting type attributes (#119495)
da-woods [Thu, 18 Sep 2025 21:08:49 +0000 (22:08 +0100)] 
gh-119494: Fix error messages for deleting/setting type attributes (#119495)

2 months agogh-136003: Skip non-daemon threads when exceptions occur during finalization (GH...
Peter Bierma [Thu, 18 Sep 2025 20:04:01 +0000 (16:04 -0400)] 
gh-136003: Skip non-daemon threads when exceptions occur during finalization (GH-139129)

During finalization, we need to mark all non-daemon threads as daemon to quickly shut down threads when sending CTRL^C to the process. This was a minor regression from GH-136004.

2 months agogh-118803: Make `ByteString` deprecations louder; remove `ByteString` from `typing...
Alex Waygood [Thu, 18 Sep 2025 18:58:16 +0000 (19:58 +0100)] 
gh-118803: Make `ByteString` deprecations louder; remove `ByteString` from `typing.__all__` and `collections.abc.__all__` (#139127)

2 months agogh-118803: Improve documentation around `ByteString` deprecation (#139115)
Alex Waygood [Thu, 18 Sep 2025 17:29:59 +0000 (18:29 +0100)] 
gh-118803: Improve documentation around `ByteString` deprecation (#139115)

2 months agogh-137976: Explicitly exclude `localtime` from `available_timezones` (#138012)
Nicholas Tindle [Thu, 18 Sep 2025 16:32:14 +0000 (11:32 -0500)] 
gh-137976: Explicitly exclude `localtime` from `available_timezones` (#138012)

* fix: available_timezones is reporting an invalid IANA zone name

* 📜🤖 Added by blurb_it.

* correct rst format for backticks

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
2 months agogh-129813, PEP 782: Use PyBytesWriter in socket recvmsg() (#139131)
Victor Stinner [Thu, 18 Sep 2025 15:57:04 +0000 (16:57 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in socket recvmsg() (#139131)

Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.

2 months agofixes gh-139090: add os.RWF_DONTCACHE (#139091)
Benjamin Peterson [Thu, 18 Sep 2025 15:13:23 +0000 (08:13 -0700)] 
fixes gh-139090: add os.RWF_DONTCACHE (#139091)

2 months agogh-129813, PEP 782: Use PyBytesWriter in bufferedio.c (#139121)
Victor Stinner [Thu, 18 Sep 2025 15:00:10 +0000 (16:00 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in bufferedio.c (#139121)

Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.

2 months agogh-129813, PEP 782: Use PyBytesWriter in _ssl (#138929)
Victor Stinner [Thu, 18 Sep 2025 14:54:18 +0000 (15:54 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in _ssl (#138929)

Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.

2 months agogh-73487: Convert `_decimal` to use Argument Clinic (part 7) (#138221)
Sergey B Kirpichev [Thu, 18 Sep 2025 14:08:27 +0000 (17:08 +0300)] 
gh-73487: Convert `_decimal` to use Argument Clinic (part 7) (#138221)

Use "defining class" converter, where possible.

2 months agogh-64490: Argument Clinic: Add support for ``**kwds`` (#138344)
Adam Turner [Thu, 18 Sep 2025 13:31:42 +0000 (14:31 +0100)] 
gh-64490: Argument Clinic: Add support for ``**kwds`` (#138344)

This adds a scaffold of support, initially only working with
strictly positional-only arguments. The FASTCALL calling
convention is not yet supported.

2 months agogh-137242: Mention Android binary releases in documentation (#138305)
Malcolm Smith [Thu, 18 Sep 2025 13:25:30 +0000 (14:25 +0100)] 
gh-137242: Mention Android binary releases in documentation (#138305)

Adds a mention of binary releases to the Android documentation.

---------
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 months agogh-139109: Dynamic opcode targets (GH-139111)
Ken Jin [Thu, 18 Sep 2025 13:12:07 +0000 (21:12 +0800)] 
gh-139109: Dynamic opcode targets (GH-139111)

Make opcode targets table dynamic

2 months agogh-129813, PEP 782: Use PyBytesWriter in _sqlite (#138956)
Victor Stinner [Thu, 18 Sep 2025 12:58:35 +0000 (13:58 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in _sqlite (#138956)

Replace PyBytes_FromStringAndSize(NULL, size) with the new public
PyBytesWriter API.

2 months agogh-135755: Make Py_TAIL_CALL_INTERP macro private (#138981)
Victor Stinner [Thu, 18 Sep 2025 12:33:07 +0000 (13:33 +0100)] 
gh-135755: Make Py_TAIL_CALL_INTERP macro private (#138981)

Rename Py_TAIL_CALL_INTERP to _Py_TAIL_CALL_INTERP.

2 months agogh-136003: Execute pre-finalization callbacks in a loop (GH-136004)
Peter Bierma [Thu, 18 Sep 2025 12:29:12 +0000 (08:29 -0400)] 
gh-136003: Execute pre-finalization callbacks in a loop (GH-136004)

2 months agogh-129813, PEP 782: Use PyBytesWriter in ssl.MemoryBIO (#139113)
Victor Stinner [Thu, 18 Sep 2025 12:25:31 +0000 (13:25 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in ssl.MemoryBIO (#139113)

Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.

2 months agoDocument `Py_AddPendingCall()` change with subinterpreters in 3.12 (GH-139117)
Peter Bierma [Thu, 18 Sep 2025 12:10:41 +0000 (08:10 -0400)] 
Document `Py_AddPendingCall()` change with subinterpreters in 3.12 (GH-139117)

Prior to 3.9, Py_AddPendingCall() would always run pending calls in the main interpreter, but then each interpreter got their own ceval state, and they were scheduled for any interpreter. In GH-104813, this was undone, so Py_AddPendingCall() would always schedule for the main interpreter.

2 months agogh-135729: Store reference to globals in `Interpreter._decref` (GH-139104)
Peter Bierma [Thu, 18 Sep 2025 11:17:51 +0000 (07:17 -0400)] 
gh-135729: Store reference to globals in `Interpreter._decref` (GH-139104)

2 months agogh-138970: Adjust tests for pegen rule flags (#139107)
Petr Viktorin [Thu, 18 Sep 2025 11:08:44 +0000 (13:08 +0200)] 
gh-138970: Adjust tests for pegen rule flags (#139107)

2 months agogh-139098: Use multiphase initialization in `_testcapi` (GH-139102)
Peter Bierma [Thu, 18 Sep 2025 11:00:50 +0000 (07:00 -0400)] 
gh-139098: Use multiphase initialization in `_testcapi` (GH-139102)

Use multiphase initialization in the _testcapi module to allow loading in subinterpreters. The isolation here isn't perfect as there's still some use of globals, but _testcapi should generally work in other interpreters.

2 months agogh-138998: `expat/refresh.sh`: Fail if Step 3 is not completed (GH-139049)
Stan Ulbrych [Thu, 18 Sep 2025 10:47:42 +0000 (11:47 +0100)] 
gh-138998: `expat/refresh.sh`: Fail if Step 3 is not completed (GH-139049)

2 months agogh-137838: Add CI for no-opt JIT (#139081)
Donghee Na [Thu, 18 Sep 2025 10:46:03 +0000 (11:46 +0100)] 
gh-137838: Add CI for no-opt JIT (#139081)

* gh-137838: Add CI for no-opt JIT

* nit

2 months agoMake Android streams respect the unbuffered (`-u`) option (#138806)
Malcolm Smith [Thu, 18 Sep 2025 10:41:21 +0000 (11:41 +0100)] 
Make Android streams respect the unbuffered (`-u`) option (#138806)

Android pipes stdout/stderr to the log, which means every write to the log
becomes a separate log line. As a result, most practical uses of stdout/stderr
should be buffered; but it doesn't hurt to preserve unbuffered handling in case
it's useful.

2 months agogh-138720: Make Buffered closed check match flush (GH-138724)
Cody Maloney [Thu, 18 Sep 2025 10:02:29 +0000 (03:02 -0700)] 
gh-138720: Make Buffered closed check match flush (GH-138724)

In `_io__Buffered_flush_impl` the macro `CHECK_CLOSED` is used to check
the `buffered*` is in a good state to be flushed. That differs slightly
from `buffered_closed`.

In some cases, that difference would result in `close()` thinking the
file needed to be flushed and closed while `flush()` thought the file
was already closed.

This could happen during GC and would result in an unraisable exception.

2 months agogh-129813, PEP 782: Optimize byteswriter_resize() (#139101)
Victor Stinner [Thu, 18 Sep 2025 09:52:16 +0000 (10:52 +0100)] 
gh-129813, PEP 782: Optimize byteswriter_resize() (#139101)

There is no need to copy the small_buffer in PyBytesWriter_Create().

2 months agogh-116943: Ensure makesetup does not choke on missing EOL in Setup.* files (#139100)
Erlend E. Aasland [Thu, 18 Sep 2025 09:25:01 +0000 (10:25 +0100)] 
gh-116943: Ensure makesetup does not choke on missing EOL in Setup.* files (#139100)

2 months agogh-129813, PEP 782: Use PyBytesWriter in _socket (#139097)
Victor Stinner [Thu, 18 Sep 2025 09:20:56 +0000 (10:20 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in _socket (#139097)

Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.

2 months agoGH-138378: Move globals-to-consts pass into main optimizer pass (GH-138379)
Mark Shannon [Thu, 18 Sep 2025 09:09:59 +0000 (10:09 +0100)] 
GH-138378: Move globals-to-consts pass into main optimizer pass (GH-138379)

2 months agoRemove unmatched closing parenthesis (GH-139082)
Rafael Fontenelle [Thu, 18 Sep 2025 09:01:09 +0000 (06:01 -0300)] 
Remove unmatched closing parenthesis (GH-139082)

2 months agoRevert gh-139075. The sumprod fix needs more work. (gh-139092)
Raymond Hettinger [Thu, 18 Sep 2025 07:05:27 +0000 (02:05 -0500)] 
Revert gh-139075.  The sumprod fix needs more work. (gh-139092)

2 months agoRemove unnecessary slice in heapq.py (gh-139087)
Oleksandr Kravets [Thu, 18 Sep 2025 05:52:46 +0000 (01:52 -0400)] 
Remove unnecessary slice in heapq.py (gh-139087)

2 months agogh-138970: Add general metadata system to the peg generator (#138971)
Pablo Galindo Salgado [Thu, 18 Sep 2025 01:17:04 +0000 (02:17 +0100)] 
gh-138970: Add general metadata system to the peg generator (#138971)

2 months agogh-139074: Fix missing high precision case in sumprod() (gh-139075)
Raymond Hettinger [Wed, 17 Sep 2025 21:50:15 +0000 (16:50 -0500)] 
gh-139074: Fix missing high precision case in sumprod() (gh-139075)

2 months agogh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and DummyProc...
Denis Sergeev [Wed, 17 Sep 2025 21:45:52 +0000 (00:45 +0300)] 
gh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and DummyProcess to use None (GH-138814)

* gh-138813: Default `BaseProcess` `kwargs` to `None` (#138814)

Set `BaseProcess.__init__(..., kwargs=None)` and initialize `kwargs` with
`dict(kwargs) if kwargs else {}`. This avoids a shared mutable default and
matches threading.Thread behavior.

Co-authored-by: Dmitrii Chuprov <cheese@altlinux.org>
* DummyProcess kwargs=None (which threading.Thread accepts properly)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 months agoGH-138355: Remove trash_delete_later from _gc_runtime_state (#138767)
Sergey Miryanov [Wed, 17 Sep 2025 20:25:24 +0000 (13:25 -0700)] 
GH-138355: Remove trash_delete_later from _gc_runtime_state (#138767)

Remove trash_delete_later and trash_delete_nesting from _gc_runtime_state.

2 months agogh-137838: Move _PyUOpInstruction buffer to PyInterpreterState (gh-138918)
Donghee Na [Wed, 17 Sep 2025 17:50:16 +0000 (18:50 +0100)] 
gh-137838: Move _PyUOpInstruction buffer to PyInterpreterState (gh-138918)

2 months agogh-86819: Add ISO-TP CAN socket constants (#23794)
Stefan Tatschner [Wed, 17 Sep 2025 17:18:04 +0000 (19:18 +0200)] 
gh-86819: Add ISO-TP CAN socket constants (#23794)

Co-authored-by: Stefan Tatschner <stefan@rumpelsepp.org>
Co-authored-by: Patrick Menschel <menschel.p@posteo.de>
2 months agogh-138714: Don't assume next block has instructions when propagating line numbers...
Dino Viehland [Wed, 17 Sep 2025 16:52:56 +0000 (17:52 +0100)] 
gh-138714: Don't assume next block has instructions when propagating line numbers (#138770)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
2 months agoGH-137630: Convert ``_interpqueues`` to use Argument Clinic (#137685)
Adam Turner [Wed, 17 Sep 2025 16:35:00 +0000 (17:35 +0100)] 
GH-137630: Convert ``_interpqueues`` to use Argument Clinic (#137685)

2 months agoGH-139067: Add example for `argparse`'s `append` action (#131389)
Moshe Kaplan [Wed, 17 Sep 2025 16:24:20 +0000 (12:24 -0400)] 
GH-139067: Add example for `argparse`'s `append` action (#131389)