]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 weeks agogh-140239: Check for statx on Android (#140395)
Jeffrey Bosboom [Tue, 21 Oct 2025 15:54:00 +0000 (08:54 -0700)] 
gh-140239: Check for statx on Android (#140395)

Android has Linux's statx, but MACHDEP is "android" on Android, so
configure doesn't check for statx on Android.  Base the check for statx
on ac_sys_system instead, which is "Linux-android" on Android, "Linux"
on other Linux distributions, and "AIX" on AIX (which has an
incompatible function named statx).

2 weeks agoGH-139951: Fix major GC performance regression (GH-140262)
Mark Shannon [Tue, 21 Oct 2025 14:22:15 +0000 (15:22 +0100)] 
GH-139951: Fix major GC performance regression (GH-140262)

* Count number of actually tracked objects, instead of trackable objects. This ensures that untracking tuples has the desired effect of reducing GC overhead

* Do not track most untrackable tuples during creation. This prevents large numbers of small tuples causing execessive GCs.

2 weeks agoGH-139436: Remove references to downloadable PDF documentation (#140416)
Adam Turner [Tue, 21 Oct 2025 12:37:06 +0000 (13:37 +0100)] 
GH-139436: Remove references to downloadable PDF documentation (#140416)

2 weeks agogh-140406: Fix memory leak upon `__hash__` returning a non-integer (GH-140411)
Peter Bierma [Tue, 21 Oct 2025 12:10:01 +0000 (08:10 -0400)] 
gh-140406: Fix memory leak upon `__hash__` returning a non-integer (GH-140411)

2 weeks agogh-83714: Fix os.statx() tests on tmpfs: st_birthtime can be None (#140407)
Victor Stinner [Tue, 21 Oct 2025 10:24:49 +0000 (12:24 +0200)] 
gh-83714: Fix os.statx() tests on tmpfs: st_birthtime can be None (#140407)

2 weeks agogh-133951: Add venv changes to documentation and whatsnew (GH-139704)
Cycloctane [Tue, 21 Oct 2025 08:52:57 +0000 (16:52 +0800)] 
gh-133951: Add venv changes to documentation and whatsnew (GH-139704)

2 weeks agogh-140398: fix memory leaks in `readline` module when `PySys_Audit` fails (#140400)
Shamil [Tue, 21 Oct 2025 07:54:34 +0000 (10:54 +0300)] 
gh-140398: fix memory leaks in `readline` module when `PySys_Audit` fails (#140400)

2 weeks agogh-139707: Better `ModuleNotFoundError` message for missing stdlib modules (GH-140219)
Stan Ulbrych [Tue, 21 Oct 2025 07:12:04 +0000 (08:12 +0100)] 
gh-139707: Better `ModuleNotFoundError` message for missing stdlib modules (GH-140219)

2 weeks agogh-140358: Bring back elapsed time and unreachable count to gc debug output (#140359)
Pål Grønås Drange [Mon, 20 Oct 2025 23:54:44 +0000 (01:54 +0200)] 
gh-140358: Bring back elapsed time and unreachable count to gc debug output (#140359)

2 weeks agogh-133601: Remove deprecated `typing.no_type_check_decorator` (#133602)
sobolevn [Mon, 20 Oct 2025 21:10:44 +0000 (00:10 +0300)] 
gh-133601: Remove deprecated `typing.no_type_check_decorator` (#133602)

2 weeks ago[Docs] Add missing note about Required/NotRequired/ReadOnly in get_type_hints() ...
Sam Bull [Mon, 20 Oct 2025 20:09:33 +0000 (21:09 +0100)] 
[Docs] Add missing note about Required/NotRequired/ReadOnly in get_type_hints() (#139565)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 weeks agogh-138891: fix star-unpack in get_annotations (#138951)
Christoph Walcher [Mon, 20 Oct 2025 19:55:08 +0000 (21:55 +0200)] 
gh-138891: fix star-unpack in get_annotations (#138951)

2 weeks agogh-133656: Remove unused import and private global in `Lib/zipimport.py` (GH-140325)
yihong [Mon, 20 Oct 2025 19:43:10 +0000 (03:43 +0800)] 
gh-133656: Remove unused import and private global in `Lib/zipimport.py` (GH-140325)

2 weeks agogh-63161: Fix tokenize.detect_encoding() (GH-139446)
Serhiy Storchaka [Mon, 20 Oct 2025 17:08:47 +0000 (20:08 +0300)] 
gh-63161: Fix tokenize.detect_encoding() (GH-139446)

* Support non-UTF-8 shebang and comments if non-UTF-8 encoding is specified.
* Detect decoding error for non-UTF-8 encoding.
* Detect null bytes in source code.

2 weeks agogh-83714: Set os.statx() members to None if missing from stx_mask (#140216)
Victor Stinner [Mon, 20 Oct 2025 15:59:12 +0000 (17:59 +0200)] 
gh-83714: Set os.statx() members to None if missing from stx_mask (#140216)

2 weeks agoDocs: replace an esoteric Von Neumann mention (#137598)
Ned Batchelder [Mon, 20 Oct 2025 14:01:20 +0000 (10:01 -0400)] 
Docs: replace an esoteric Von Neumann mention (#137598)

* Docs: replace an esoteric Von Neumann mention

* oops, don't need to edit topics.py

2 weeks agogh-140263: Fix data race in test_lock_two_threads (gh-140264)
Sam Gross [Mon, 20 Oct 2025 13:58:05 +0000 (09:58 -0400)] 
gh-140263: Fix data race in test_lock_two_threads (gh-140264)

Clang-20 detects a data race between the unlock and the non-atomic
read of the lock state. Use a relaxed load for the assertion to avoid
the race.

2 weeks agogh-140166: Use `application/texinfo` as sole MIME type for `.texi` and `.texinfo...
Charlie Lin [Mon, 20 Oct 2025 13:14:23 +0000 (09:14 -0400)] 
gh-140166: Use `application/texinfo` as sole MIME type for `.texi` and `.texinfo` files (#140165)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 weeks agogh-76007: Deprecate `__version__` attribute in `imaplib` (#140299)
Hugo van Kemenade [Mon, 20 Oct 2025 12:20:44 +0000 (15:20 +0300)] 
gh-76007: Deprecate `__version__` attribute in `imaplib` (#140299)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 weeks agogh-66646: Explain __base__ attribute in the docs (GH-102554)
Furkan Onder [Mon, 20 Oct 2025 12:15:30 +0000 (21:15 +0900)] 
gh-66646: Explain __base__ attribute in the docs (GH-102554)

Co-authored-by: Éric <merwok@netwok.org>
2 weeks agogh-139951: Test on GC collection disabled if threshold is zero (GH-140304)
Mikhail Efimov [Mon, 20 Oct 2025 10:45:07 +0000 (13:45 +0300)] 
gh-139951: Test on GC collection disabled if threshold is zero (GH-140304)

2 weeks agogh-140301: Fix memory leak in subinterpreter `PyConfig` cleanup (#140303)
Shamil [Mon, 20 Oct 2025 09:29:23 +0000 (12:29 +0300)] 
gh-140301: Fix memory leak in subinterpreter `PyConfig` cleanup (#140303)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2 weeks agofix typo in comments PyOS_CallInputHook -> PyOS_InputHook (#140237)
mdehoon [Mon, 20 Oct 2025 08:55:57 +0000 (17:55 +0900)] 
fix typo in comments PyOS_CallInputHook -> PyOS_InputHook (#140237)

2 weeks agoRemove typo in ``functools.lru_cache`` docs (#140278)
Brandon Hubacher [Mon, 20 Oct 2025 08:55:01 +0000 (03:55 -0500)] 
Remove typo in ``functools.lru_cache`` docs (#140278)

2 weeks agoFix typo in PyIter_Send docs (#140336)
Peter Holloway [Mon, 20 Oct 2025 08:53:57 +0000 (09:53 +0100)] 
Fix typo in PyIter_Send docs (#140336)

2 weeks agogh-101100: Fix sphinx warnings in `library/resource.rst` (#140023)
Weilin Du [Mon, 20 Oct 2025 07:15:40 +0000 (15:15 +0800)] 
gh-101100: Fix sphinx warnings in `library/resource.rst` (#140023)

2 weeks ago`zlib.rst`: Link to constants and deduplicate text (GH-140115)
Stan Ulbrych [Mon, 20 Oct 2025 04:22:39 +0000 (05:22 +0100)] 
`zlib.rst`: Link to constants and deduplicate text (GH-140115)

* Link to compression setting constants from compression functions
* De-duplicate descriptions of the constants

Co-authored-by: Victor Stinner <vstinner@python.org>
2 weeks agodocs: be clearer that glob results are unordered (#140184)
Ned Batchelder [Sun, 19 Oct 2025 20:16:35 +0000 (16:16 -0400)] 
docs: be clearer that glob results are unordered (#140184)

* docs: be clearer that glob results are unordered

* trim down the opening paragraph

2 weeks agogh-140306: Fix memory leaks in cross-interpreter data handling (GH-140307)
Shamil [Sun, 19 Oct 2025 19:24:28 +0000 (22:24 +0300)] 
gh-140306: Fix memory leaks in cross-interpreter data handling (GH-140307)

2 weeks agogh-101525: [BOLT] Add GCC's LTO-generated function clones, with computed gotos, to...
stratakis [Sun, 19 Oct 2025 14:23:49 +0000 (16:23 +0200)] 
gh-101525: [BOLT] Add GCC's LTO-generated function clones, with computed gotos, to BOLT skip list (gh-139840)

2 weeks ago`Lib/idlelib/idle_test/__init__.py`: remove commented out duplicate code (#140259)
Stan Ulbrych [Sun, 19 Oct 2025 04:16:13 +0000 (05:16 +0100)] 
`Lib/idlelib/idle_test/__init__.py`: remove commented out duplicate code (#140259)

2 weeks agogh-138997: Remove false justify `fill` option from Tkinter docs (#139023)
Marat Khagazheev [Sun, 19 Oct 2025 03:45:52 +0000 (06:45 +0300)] 
gh-138997: Remove false justify `fill` option from Tkinter docs (#139023)

Co-authored-by: marat <khagazheev@artlebedev.ru>
2 weeks agogh-139269: Fix unaligned memory access in JIT code patching functions (GH-139271)
Shamil [Sat, 18 Oct 2025 23:20:04 +0000 (02:20 +0300)] 
gh-139269: Fix unaligned memory access in JIT code patching functions (GH-139271)

* Use memcpy for patching values instead of direct assignment

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2 weeks agogh-128571: Document UTF-16/32 native byte order (#139974)
Parham MohammadAlizadeh [Sat, 18 Oct 2025 18:47:04 +0000 (19:47 +0100)] 
gh-128571: Document UTF-16/32 native byte order (#139974)

Closes #128571

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2 weeks agogh-140251: colorize import statement formatting in asyncio console (#140252)
Frost Ming [Sat, 18 Oct 2025 14:35:24 +0000 (22:35 +0800)] 
gh-140251: colorize import statement formatting in asyncio console (#140252)

2 weeks agogh-140067: Fix memory leak in sub-interpreter creation (#140111) (#140261)
Kumar Aditya [Sat, 18 Oct 2025 11:06:58 +0000 (16:36 +0530)] 
gh-140067: Fix memory leak in sub-interpreter creation (#140111)  (#140261)

Fix memory leak in sub-interpreter creation caused by overwriting of the previously used `_malloced` field. Now the pointer is stored in the first word of the memory block to avoid it being overwritten accidentally.

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2 weeks agogh-140257: fix data race on eval_breaker during finalization (#140265)
Shamil [Sat, 18 Oct 2025 11:01:53 +0000 (14:01 +0300)] 
gh-140257: fix data race on eval_breaker during finalization (#140265)

2 weeks agogh-140241: Fix documentation for the registry parameter of warnings.warn_explicit...
Serhiy Storchaka [Sat, 18 Oct 2025 10:55:26 +0000 (13:55 +0300)] 
gh-140241: Fix documentation for the registry parameter of warnings.warn_explicit() (GH-140242)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2 weeks agoMove the NEWS entry for gh-140272 to the correct place (GH-140290)
Serhiy Storchaka [Sat, 18 Oct 2025 10:54:40 +0000 (13:54 +0300)] 
Move the NEWS entry for gh-140272 to the correct place (GH-140290)

2 weeks agogh-140272: Fix memory leak in _gdbm.gdbm.clear() (GH-140274)
Shamil [Sat, 18 Oct 2025 09:27:58 +0000 (12:27 +0300)] 
gh-140272: Fix memory leak in _gdbm.gdbm.clear() (GH-140274)

2 weeks agoGH-139174: Prepare `pathlib.Path.info` for new methods (part 2) (#140155)
Barney Gale [Sat, 18 Oct 2025 01:13:25 +0000 (02:13 +0100)] 
GH-139174: Prepare `pathlib.Path.info` for new methods (part 2) (#140155)

Merge `_Info`, `_StatResultInfo` and `_DirEntryInfo` into a single `_Info`
class. No other changes.

This will allow us to use a cached `os.stat()` result from our upcoming
`_Info.stat()` method even when we have a backing `os.DirEntry`.

2 weeks agoGH-133789: Fix unpickling of pathlib objects pickled in Python 3.13 (#133831)
Barney Gale [Fri, 17 Oct 2025 21:57:51 +0000 (22:57 +0100)] 
GH-133789: Fix unpickling of pathlib objects pickled in Python 3.13 (#133831)

In Python 3.13 (but not 3.12 or 3.14), pathlib classes are defined in
`pathlib._local` rather than `pathlib`. In hindsight this was a mistake,
but it was difficult to predict how the abstract/local split would pan out.

In this patch we re-introduce `pathlib._local` as a stub module that
re-exports the classes from `pathlib`. This allows path objects pickled in
3.13 to be unpicked in 3.14+

3 weeks agogh-140239: Check statx availability only on Linux (#140249)
Ayappan Perumal [Fri, 17 Oct 2025 17:40:16 +0000 (23:10 +0530)] 
gh-140239: Check statx availability only on Linux (#140249)

3 weeks agogh-135801: Add tests for filtering warnings by module (GH-140240)
Serhiy Storchaka [Fri, 17 Oct 2025 11:21:39 +0000 (14:21 +0300)] 
gh-135801: Add tests for filtering warnings by module (GH-140240)

3 weeks agogh-133059: Update documentation of preallocated integer range in `long.rst` (GH-140231)
Tomasz Dądela [Fri, 17 Oct 2025 10:32:02 +0000 (12:32 +0200)] 
gh-133059: Update documentation of preallocated integer range in `long.rst` (GH-140231)

3 weeks agoGH-135904: Implement assembler optimization for AArch64. (GH-139855)
Mark Shannon [Fri, 17 Oct 2025 10:26:17 +0000 (11:26 +0100)] 
GH-135904: Implement assembler optimization for AArch64. (GH-139855)

3 weeks agogh-133059: Fix `Tools/build/deepfreeze.py` for new nsmallposints (#139906)
Albert N [Fri, 17 Oct 2025 08:48:53 +0000 (11:48 +0300)] 
gh-133059: Fix `Tools/build/deepfreeze.py` for new nsmallposints (#139906)

3 weeks agoStandardize translation of `Doc/bugs.rst` (GH-137449)
Stan Ulbrych [Fri, 17 Oct 2025 06:55:12 +0000 (07:55 +0100)] 
Standardize translation of `Doc/bugs.rst` (GH-137449)

3 weeks agogh-116738: test `uuid` module thread safety in free-threading (#140068)
Alper [Thu, 16 Oct 2025 18:27:51 +0000 (11:27 -0700)] 
gh-116738: test `uuid` module thread safety in free-threading (#140068)

3 weeks agoRemove duplicate words in the documentation (#140221)
Tan Long [Thu, 16 Oct 2025 17:27:00 +0000 (01:27 +0800)] 
Remove duplicate words in the documentation (#140221)

3 weeks agogh-140149: Use PyBytesWriter in _build_concatenated_bytes() (#140150)
Maurycy Pawłowski-Wieroński [Thu, 16 Oct 2025 17:24:34 +0000 (19:24 +0200)] 
gh-140149: Use PyBytesWriter in _build_concatenated_bytes() (#140150)

Use PyBytesWriter in action_helpers.c _build_concatenated_bytes().
3x faster bytes concat in the parser.

Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks agogh-140078: fix typo in tkinter docs (#140081)
wangxiaolei [Thu, 16 Oct 2025 15:02:38 +0000 (23:02 +0800)] 
gh-140078: fix typo in tkinter docs (#140081)

Remove extraneous word.

3 weeks agogh-138859: Account for `ParamSpec` defaults that are not lists … (#138868)
bzoracler [Thu, 16 Oct 2025 12:30:36 +0000 (01:30 +1300)] 
gh-138859: Account for `ParamSpec` defaults that are not lists … (#138868)

3 weeks agogh-83714: Check for struct statx.stx_atomic_write_unit_max_opt in configure (#140185)
Jeffrey Bosboom [Thu, 16 Oct 2025 11:40:47 +0000 (04:40 -0700)] 
gh-83714: Check for struct statx.stx_atomic_write_unit_max_opt in configure (#140185)

stx_atomic_write_unit_max_opt was added in Linux 6.16, but is controlled
by the STATX_WRITE_ATOMIC mask bit added in Linux 6.11.  That's safe at
runtime because all kernels clear the reserved space in struct statx and
zero is a valid value for stx_atomic_write_unit_max_opt, and it avoids
allocating another mask bit, which are a limited resource.  But it also
means the kernel headers don't provide a way to check whether
stx_atomic_write_unit_max_opt exists, so add a configure check.

3 weeks agogh-139817: Fix refleak in TypeAliasType(qualname=non_string) (GH-140197)
Petr Viktorin [Thu, 16 Oct 2025 11:04:04 +0000 (13:04 +0200)] 
gh-139817: Fix refleak in TypeAliasType(qualname=non_string) (GH-140197)

3 weeks agoSet type names earlier in posixmodule.c (#140168)
Victor Stinner [Thu, 16 Oct 2025 10:54:57 +0000 (12:54 +0200)] 
Set type names earlier in posixmodule.c (#140168)

3 weeks agogh-140170: Fix test_site with -s flag (GH-140179)
Stan Ulbrych [Thu, 16 Oct 2025 09:49:08 +0000 (10:49 +0100)] 
gh-140170: Fix test_site with -s flag (GH-140179)

Commit

3 weeks agogh-130567: Remove optimistic allocation in locale.strxfrm() (GH-137143)
Serhiy Storchaka [Thu, 16 Oct 2025 07:54:41 +0000 (10:54 +0300)] 
gh-130567: Remove optimistic allocation in locale.strxfrm() (GH-137143)

On modern systems, the result of wcsxfrm() is much larger the size of
the input string (from 4+2*n on Windows to 4+5*n on Linux for simple
ASCII strings), so optimistic allocation of the buffer of the same size
never works.

The exception is if the locale is "C" (or unset), but in that case the `wcsxfrm`
call should be fast (and calling `locale.strxfrm()` doesn't make too much
sense in the first place).

3 weeks agogh-140120: Refresh HACL* to fix an hmac memory leak (GH-140188)
Jonathan Protzenko [Thu, 16 Oct 2025 05:25:51 +0000 (13:25 +0800)] 
gh-140120: Refresh HACL* to fix an hmac memory leak (GH-140188)

This pulls an updated version of HACL* that fixes the memory leak reported in #140120, via an upstream fix.

3 weeks agogh-140041: Fix import of `ctypes` on Android and Cygwin when ABI flags are present...
Malcolm Smith [Wed, 15 Oct 2025 21:40:39 +0000 (22:40 +0100)] 
gh-140041: Fix import of `ctypes` on Android and Cygwin when ABI flags are present (#140178)

Use sysconfig to determine the full name of libpython, rather than hardcoding
a library name that doesn't have ABI flags.

3 weeks agogh-139817: typing docs: Fix indentation of `.. versionadded::` note for `TypeAliasTyp...
Alex Waygood [Wed, 15 Oct 2025 20:18:39 +0000 (21:18 +0100)] 
gh-139817: typing docs: Fix indentation of `.. versionadded::` note for `TypeAliasType.__qualname__` (#140177)

3 weeks agogh-140141: Properly break exception chain in `importlib.metadata.Distribution.from_na...
Bartosz Sławecki [Wed, 15 Oct 2025 16:49:14 +0000 (18:49 +0200)] 
gh-140141: Properly break exception chain in `importlib.metadata.Distribution.from_name` (#140142)

3 weeks agogh-139817: Attribute `__qualname__` is added to `TypeAliasType` (#139919)
Mikhail Efimov [Wed, 15 Oct 2025 16:08:17 +0000 (19:08 +0300)] 
gh-139817: Attribute `__qualname__` is added to `TypeAliasType` (#139919)

3 weeks agogh-83714: Disable os.statx_result.stx_atomic_write_unit_max_opt (#140162)
Victor Stinner [Wed, 15 Oct 2025 15:38:34 +0000 (17:38 +0200)] 
gh-83714: Disable os.statx_result.stx_atomic_write_unit_max_opt (#140162)

Fix building on Centos 9 x86-64 buildbot.

3 weeks agogh-140065: Lexical analysis: Correct note about leading zeros in floating point numbe...
Stan Ulbrych [Wed, 15 Oct 2025 15:15:45 +0000 (16:15 +0100)] 
gh-140065: Lexical analysis: Correct note about leading zeros in floating point numbers (GH-140066)

3 weeks agogh-140153: Fix Py_REFCNT() definition on limited C API 3.11-3.13 (#140158)
Victor Stinner [Wed, 15 Oct 2025 14:36:49 +0000 (16:36 +0200)] 
gh-140153: Fix Py_REFCNT() definition on limited C API 3.11-3.13 (#140158)

3 weeks agogh-140135: Use `PyBytesWriter` in `io.RawIOBase.readall()`; 4x faster (#140139)
Maurycy Pawłowski-Wieroński [Wed, 15 Oct 2025 14:04:17 +0000 (16:04 +0200)] 
gh-140135: Use `PyBytesWriter` in `io.RawIOBase.readall()`; 4x faster (#140139)

3 weeks agogh-140137: Handle empty collections in profiling.sampling (#140154)
Pablo Galindo Salgado [Wed, 15 Oct 2025 13:59:12 +0000 (14:59 +0100)] 
gh-140137: Handle empty collections in profiling.sampling (#140154)

3 weeks agogh-140080: Clear `atexit` callbacks when memory allocation fails during finalization...
yihong [Wed, 15 Oct 2025 13:49:55 +0000 (21:49 +0800)] 
gh-140080: Clear `atexit` callbacks when memory allocation fails during finalization (GH-140103)

This fixes a regression introduced by GH-136004, in which finalization would hang while executing atexit handlers if the system was out of memory.

---------

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks agogh-140061: Use `_PyObject_IsUniquelyReferenced()` to check if objects are uniquely...
Sergey Miryanov [Wed, 15 Oct 2025 13:48:21 +0000 (18:48 +0500)] 
gh-140061: Use `_PyObject_IsUniquelyReferenced()` to check if objects are uniquely referenced (gh-140062)

The previous `Py_REFCNT(x) == 1` checks can have data races in the free
threaded build. `_PyObject_IsUniquelyReferenced(x)` is a more conservative
check that is safe in the free threaded build and is identical to
`Py_REFCNT(x) == 1` in the default GIL-enabled build.

3 weeks agogh-83714: Implement os.statx() function (#139178)
Jeffrey Bosboom [Wed, 15 Oct 2025 13:44:08 +0000 (06:44 -0700)] 
gh-83714: Implement os.statx() function (#139178)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks agogh-139327: consolidate `sqlite3_finalize` and `sqlite3_reset` usages (GH-139329)
Bénédikt Tran [Wed, 15 Oct 2025 13:18:07 +0000 (15:18 +0200)] 
gh-139327: consolidate `sqlite3_finalize` and `sqlite3_reset` usages (GH-139329)

3 weeks agogh-129813: Enhance PyBytesWriter documentation (#140152)
Victor Stinner [Wed, 15 Oct 2025 12:54:18 +0000 (14:54 +0200)] 
gh-129813: Enhance PyBytesWriter documentation (#140152)

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
3 weeks agogh-76007: Deprecate `zlib.__version__` attribute (#140130)
Stan Ulbrych [Wed, 15 Oct 2025 11:18:48 +0000 (12:18 +0100)] 
gh-76007: Deprecate `zlib.__version__` attribute (#140130)

3 weeks agogh-129559: Remove extra dot in bytearray.resize AC (#140134) 140148/head
Cody Maloney [Wed, 15 Oct 2025 02:39:17 +0000 (19:39 -0700)] 
gh-129559: Remove extra dot in bytearray.resize AC (#140134)

3 weeks agoRevert "gh-140067: Fix memory leak in sub-interpreter creation (#140111)" (#140140)
Peter Bierma [Wed, 15 Oct 2025 01:46:43 +0000 (21:46 -0400)] 
Revert "gh-140067: Fix memory leak in sub-interpreter creation  (#140111)" (#140140)

This reverts commit 59547a251f7069dc6e08cb6082dd21872671e381.

3 weeks agogh-140126: Fix compile error if --with-assertions is enabled (#140133)
Neil Schemenauer [Tue, 14 Oct 2025 23:34:30 +0000 (16:34 -0700)] 
gh-140126: Fix compile error if --with-assertions is enabled (#140133)

The `types_world_is_stopped()` function needs to be defined if NDEBUG
is not defined.

3 weeks agoUpdate documented minimum required zlib library version (#140116)
Stan Ulbrych [Tue, 14 Oct 2025 22:16:00 +0000 (23:16 +0100)] 
Update documented minimum required zlib library version (#140116)

3 weeks agoImprove the comment in URLError (#139874)
SarahPythonista [Tue, 14 Oct 2025 19:31:21 +0000 (12:31 -0700)] 
Improve the comment in URLError (#139874)

Clarify that it It overrides `__init__` and `__str__`.

3 weeks agogh-139877: Use PyBytesWriter in pycore_blocks_output_buffer.h (#139976)
Emma Smith [Tue, 14 Oct 2025 17:03:55 +0000 (10:03 -0700)] 
gh-139877: Use PyBytesWriter in pycore_blocks_output_buffer.h (#139976)

Previously, the _BlocksOutputBuffer code creates a list of bytes objects to handle the output data from compression libraries. This ends up being slow due to the output buffer code needing to copy each bytes element of the list into the final bytes object buffer at the end of compression.

The new PyBytesWriter API introduced in PEP 782 is an ergonomic and fast method of writing data into a buffer that will later turn into a bytes object. Benchmarks show that using the PyBytesWriter API is 10-30% faster for decompression across a variety of settings. The performance gains are greatest when the decompressor is very performant, such as for Zstandard (and likely zlib-ng). Otherwise the decompressor can bottleneck decompression and the gains are more modest, but still sizable (e.g. 10% faster for zlib)!

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
3 weeks agoAdd mention of other fixed bug in the gh-139640 NEWS entry (GH-140122)
Serhiy Storchaka [Tue, 14 Oct 2025 15:56:19 +0000 (18:56 +0300)] 
Add mention of other fixed bug in the gh-139640 NEWS entry (GH-140122)

3 weeks agoCorrect a simple NULL-check in `optimizer.c`'s `uop_item()` (GH-140069)
Maurycy Pawłowski-Wieroński [Tue, 14 Oct 2025 15:18:20 +0000 (17:18 +0200)] 
Correct a simple NULL-check in `optimizer.c`'s `uop_item()` (GH-140069)

3 weeks agogh-139640: Fix swallowing syntax warnings in different modules (GH-139755)
Serhiy Storchaka [Tue, 14 Oct 2025 14:48:09 +0000 (17:48 +0300)] 
gh-139640: Fix swallowing syntax warnings in different modules (GH-139755)

Revert GH-131993.

Fix swallowing some syntax warnings in different modules if they accidentally
have the same message and are emitted from the same line.

3 weeks agoMerge branch 'main' of https://github.com/python/cpython
Hugo van Kemenade [Tue, 14 Oct 2025 14:45:22 +0000 (17:45 +0300)] 
Merge branch 'main' of https://github.com/python/cpython

3 weeks agogh-140067: Fix memory leak in sub-interpreter creation (#140111)
Shamil [Tue, 14 Oct 2025 14:42:17 +0000 (17:42 +0300)] 
gh-140067: Fix memory leak in sub-interpreter creation  (#140111)

Fix memory leak in sub-interpreter creation caused by overwriting of the previously used `_malloced` field. Now the pointer is stored in the first word of the memory block to avoid it being overwritten accidentally.

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
3 weeks agoMerge branch 'main' of https://github.com/python/cpython
Hugo van Kemenade [Tue, 14 Oct 2025 14:41:22 +0000 (17:41 +0300)] 
Merge branch 'main' of https://github.com/python/cpython

3 weeks agoPost 3.15.0a1
Hugo van Kemenade [Tue, 14 Oct 2025 14:36:01 +0000 (17:36 +0300)] 
Post 3.15.0a1

3 weeks agogh-106318: Add examples for str.istitle() (#140046)
Adorilson Bezerra [Tue, 14 Oct 2025 14:19:27 +0000 (11:19 -0300)] 
gh-106318: Add examples for str.istitle()  (#140046)

3 weeks agogh-101828: Fix `jisx0213` codecs removing null characters (gh-139340)
Stan Ulbrych [Tue, 14 Oct 2025 13:55:00 +0000 (14:55 +0100)] 
gh-101828: Fix `jisx0213` codecs removing null characters (gh-139340)

3 weeks agoGH-140058: Clear key and value if `PyTuple_New` fails in `dictiter_iternextitem`...
Sergey Miryanov [Tue, 14 Oct 2025 12:45:39 +0000 (17:45 +0500)] 
GH-140058: Clear key and value if `PyTuple_New` fails in `dictiter_iternextitem` (#140059)

3 weeks agogh-102431: Clarify constraints on operands of Decimal logical operations (GH-102836)
Sergey B Kirpichev [Tue, 14 Oct 2025 11:02:02 +0000 (14:02 +0300)] 
gh-102431: Clarify constraints on operands of Decimal logical operations (GH-102836)

Sync C/Python implementation of the decimal: logical_ops for contexts.

3 weeks agoPython 3.15.0a1 v3.15.0a1
Hugo van Kemenade [Tue, 14 Oct 2025 10:45:53 +0000 (13:45 +0300)] 
Python 3.15.0a1

3 weeks agogh-133879: Copyedit "What's new in Python 3.15" (#140007)
Hugo van Kemenade [Tue, 14 Oct 2025 10:32:55 +0000 (13:32 +0300)] 
gh-133879: Copyedit "What's new in Python 3.15" (#140007)

3 weeks agogh-137634: Modernize `calendar.HTMLCalendar` output (#137635)
Wulian233 [Tue, 14 Oct 2025 10:25:12 +0000 (18:25 +0800)] 
gh-137634: Modernize `calendar.HTMLCalendar` output (#137635)

3 weeks agogh-139958: Add TOML MIME type (#139959)
Gil Forcada Codinachs [Tue, 14 Oct 2025 10:20:14 +0000 (12:20 +0200)] 
gh-139958: Add TOML MIME type (#139959)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
3 weeks agogh-90949: Recommend `hasattr` with Expat security methods (#139800)
Sebastian Pipping [Tue, 14 Oct 2025 10:18:09 +0000 (12:18 +0200)] 
gh-90949: Recommend `hasattr` with Expat security methods (#139800)

3 weeks agogh-114827: clarify `threading.Event.wait` timeout behavior (#114834)
Doug Hoskisson [Tue, 14 Oct 2025 08:34:53 +0000 (01:34 -0700)] 
gh-114827: clarify `threading.Event.wait` timeout behavior (#114834)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
3 weeks agogh-82575: Adjust `time.get_clock_info` *adjustable* attribute doc (#135920)
Stan Ulbrych [Tue, 14 Oct 2025 08:30:56 +0000 (09:30 +0100)] 
gh-82575: Adjust `time.get_clock_info` *adjustable* attribute doc (#135920)

3 weeks agogh-137871: Clarify cmath.nan documentation by linking to math module (#137876)
Aziz [Tue, 14 Oct 2025 08:24:43 +0000 (10:24 +0200)] 
gh-137871: Clarify cmath.nan documentation by linking to math module (#137876)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
3 weeks agogh-97914: Reword misleading sentence on conditional expressions (#139064)
Irit Katriel [Tue, 14 Oct 2025 08:21:13 +0000 (09:21 +0100)] 
gh-97914: Reword misleading sentence on conditional expressions (#139064)

Co-authored-by: Gilles Peiffer <gilles.peiffer.yt@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>