Commit graph

128785 commits

Author SHA1 Message Date
Victor Stinner
4641925bf2
Set type names earlier in posixmodule.c (#140168) 2025-10-16 12:54:57 +02:00
Stan Ulbrych
7ac94fcb1d
gh-140170: Fix test_site with -s flag (GH-140179)
Commit
2025-10-16 12:49:08 +03:00
Serhiy Storchaka
2a2bc82cef
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).
2025-10-16 09:54:41 +02:00
Jonathan Protzenko
3a81313019
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.
2025-10-16 05:25:51 +00:00
Malcolm Smith
7f371ed84b
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.
2025-10-16 05:40:39 +08:00
Alex Waygood
65d1a14d59
gh-139817: typing docs: Fix indentation of .. versionadded:: note for TypeAliasType.__qualname__ (#140177) 2025-10-15 20:18:39 +00:00
Bartosz Sławecki
bcced02604
gh-140141: Properly break exception chain in importlib.metadata.Distribution.from_name (#140142) 2025-10-15 12:49:14 -04:00
Mikhail Efimov
f673f0e7b4
gh-139817: Attribute __qualname__ is added to TypeAliasType (#139919) 2025-10-15 09:08:17 -07:00
Victor Stinner
5213f1b684
gh-83714: Disable os.statx_result.stx_atomic_write_unit_max_opt (#140162)
Fix building on Centos 9 x86-64 buildbot.
2025-10-15 17:38:34 +02:00
Stan Ulbrych
1624c646b0
gh-140065: Lexical analysis: Correct note about leading zeros in floating point numbers (GH-140066) 2025-10-15 15:15:45 +00:00
Victor Stinner
728d239e57
gh-140153: Fix Py_REFCNT() definition on limited C API 3.11-3.13 (#140158) 2025-10-15 16:36:49 +02:00
Maurycy Pawłowski-Wieroński
d301587369
gh-140135: Use PyBytesWriter in io.RawIOBase.readall(); 4x faster (#140139) 2025-10-15 14:04:17 +00:00
Pablo Galindo Salgado
0c66da8de4
gh-140137: Handle empty collections in profiling.sampling (#140154) 2025-10-15 14:59:12 +01:00
yihong
a05aece543
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>
2025-10-15 09:49:55 -04:00
Sergey Miryanov
32c264982e
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.
2025-10-15 09:48:21 -04:00
Jeffrey Bosboom
fe9ac7fc8c
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>
2025-10-15 13:44:08 +00:00
Bénédikt Tran
27acaf1cb7
gh-139327: consolidate sqlite3_finalize and sqlite3_reset usages (GH-139329) 2025-10-15 15:18:07 +02:00
Victor Stinner
4126d9f1ab
gh-129813: Enhance PyBytesWriter documentation (#140152)
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2025-10-15 14:54:18 +02:00
Stan Ulbrych
46f11b36ad
gh-76007: Deprecate zlib.__version__ attribute (#140130) 2025-10-15 13:18:48 +02:00
Cody Maloney
6416e6ebe5
gh-129559: Remove extra dot in bytearray.resize AC (#140134) 2025-10-15 02:39:17 +00:00
Peter Bierma
0bcb1c25f7
Revert "gh-140067: Fix memory leak in sub-interpreter creation (#140111)" (#140140)
This reverts commit 59547a251f.
2025-10-15 07:16:43 +05:30
Neil Schemenauer
1e1f435196
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.
2025-10-14 23:34:30 +00:00
Stan Ulbrych
2ca3c85054
Update documented minimum required zlib library version (#140116) 2025-10-15 00:16:00 +02:00
SarahPythonista
c50d794c7b
Improve the comment in URLError (#139874)
Clarify that it It overrides `__init__` and `__str__`.
2025-10-14 12:31:21 -07:00
Emma Smith
f262297d52
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>
2025-10-14 10:03:55 -07:00
Serhiy Storchaka
404425575c
Add mention of other fixed bug in the gh-139640 NEWS entry (GH-140122) 2025-10-14 18:56:19 +03:00
Maurycy Pawłowski-Wieroński
3490a99046
Correct a simple NULL-check in optimizer.c's uop_item() (GH-140069) 2025-10-14 16:18:20 +01:00
Serhiy Storchaka
279db6bede
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.
2025-10-14 17:48:09 +03:00
Hugo van Kemenade
1ff6d69fbe Merge branch 'main' of https://github.com/python/cpython 2025-10-14 17:45:22 +03:00
Shamil
59547a251f
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>
2025-10-14 14:42:17 +00:00
Hugo van Kemenade
348a26ff0e Merge branch 'main' of https://github.com/python/cpython 2025-10-14 17:41:22 +03:00
Hugo van Kemenade
983c8db61e Post 3.15.0a1 2025-10-14 17:36:01 +03:00
Adorilson Bezerra
07e617ecc2
gh-106318: Add examples for str.istitle() (#140046) 2025-10-14 17:19:27 +03:00
Stan Ulbrych
87eadce3e0
gh-101828: Fix jisx0213 codecs removing null characters (gh-139340) 2025-10-14 22:55:00 +09:00
Sergey Miryanov
ded59f7e8e
GH-140058: Clear key and value if PyTuple_New fails in dictiter_iternextitem (#140059) 2025-10-14 18:15:39 +05:30
Sergey B Kirpichev
6ecf77dbde
gh-102431: Clarify constraints on operands of Decimal logical operations (GH-102836)
Sync C/Python implementation of the decimal: logical_ops for contexts.
2025-10-14 11:02:02 +00:00
Hugo van Kemenade
aeff92d86a Python 3.15.0a1 2025-10-14 13:46:08 +03:00
Hugo van Kemenade
f71c96cf2d
gh-133879: Copyedit "What's new in Python 3.15" (#140007) 2025-10-14 13:32:55 +03:00
Wulian233
5976432138
gh-137634: Modernize calendar.HTMLCalendar output (#137635) 2025-10-14 13:25:12 +03:00
Gil Forcada Codinachs
253534515c
gh-139958: Add TOML MIME type (#139959)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-14 13:20:14 +03:00
Sebastian Pipping
0c17473513
gh-90949: Recommend hasattr with Expat security methods (#139800) 2025-10-14 13:18:09 +03:00
Doug Hoskisson
13e9c2d18d
gh-114827: clarify threading.Event.wait timeout behavior (#114834)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-14 11:34:53 +03:00
Stan Ulbrych
e6102f0755
gh-82575: Adjust time.get_clock_info *adjustable* attribute doc (#135920) 2025-10-14 11:30:56 +03:00
Aziz
025b4034d6
gh-137871: Clarify cmath.nan documentation by linking to math module (#137876)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-10-14 11:24:43 +03:00
Irit Katriel
fb25d6b35c
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>
2025-10-14 11:21:13 +03:00
Morteza24
362fd59dc8
gh-138072: Fix typos and grammatical errors and improve clarity in asyncio howto document (#138895) 2025-10-14 11:19:35 +03:00
Loïc Simon
7caa591bb9
gh-102247: Improve documentation of http.HTTPStatus members update (#133190) 2025-10-14 11:18:17 +03:00
Stan Ulbrych
207f977bc7
gh-138993: Dedent credits text (#138994) 2025-10-14 11:15:17 +03:00
Weilin Du
6ca91834b8
gh-101100: Fix sphinx warnings in library/smtplib.rst (#139991)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-14 11:12:24 +03:00
Rafael Fontenelle
f70082b477
gh-70765: Remove unnecessary extra backtick from Changelog entry (#140071) 2025-10-14 11:05:59 +03:00