Commit graph

130703 commits

Author SHA1 Message Date
Lysandros Nikolaou
79b91e7c50
gh-142518: Document thread-safety guarantees of set objects (#145225) 2026-03-13 14:53:01 +01:00
Michiel W. Beijen
61f2a1a599
GH-60729: Add IEEE format wave audio support (GH-145384)
Co-authored-by: Lionel Koenig <lionelk@google.com>
2026-03-13 14:10:48 +01:00
Jason Yalim, PhD
f884dc6f70
gh-140715: Add %t and %n format codes support to strptime() (GH-144896)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-13 14:00:39 +01:00
Furkan Onder
9162238511
gh-99631: Add shelve custom serialization to What's New in 3.15 (#145253) 2026-03-13 14:38:06 +02:00
VanshAgarwal24036
59d97683c1
gh-145792: Fix incorrect alloca allocation size in traceback.c (#145814) 2026-03-13 13:15:26 +01:00
devdanzin
0b6a2346e5
gh-145887: Use write() instead of stream.write() in PrettyPrinter._pprint_frozendict (#145894) 2026-03-13 12:57:35 +01:00
Serhiy Storchaka
962fb872eb
gh-145850: Change some implementation details in struct.Struct (GH-145851)
* calling it with non-ASCII string format will now raise a ValueError
  instead of UnicodeEncodeError
* calling it with non-ASCII bytes format will now raise a ValueError
  instead of struct.error
* getting the format attribute of uninitialized object will now raise
  an AttributeError instead of RuntimeError.
2026-03-13 13:05:41 +02:00
Stan Ulbrych
e1c224624a
gh-145783: Propagate errors raised in NEW_TYPE_COMMENT (#145784) 2026-03-13 11:05:20 +00:00
Maurizio Sambati
6d1e9ceed3
Docs: except with multiple exceptions parentheses not required (#145848)
As of PEP 758 the except statement doesn't require parentheses anymore for exception tuples.

See: https://peps.python.org/pep-0758/
2026-03-13 05:40:20 -04:00
Stan Ulbrych
0adc7289c3
Revert "gh-143050: Remove redundant decref in _PyLong_Negate (gh-143051)" (#145891)
OSS Fuzzer caught an assertion failure.

This reverts commit 5197ecb5e4.
2026-03-12 21:53:29 -04:00
Victor Stinner
08a018ebe0
gh-145801: Use gcc -fprofile-update=atomic for PGO builds (#145802)
When Python build is optimized with GCC using PGO, use
-fprofile-update=atomic option to use atomic operations when updating
profile information. This option reduces the risk of gcov Data Files
(.gcda) corruption which can cause random GCC crashes.
2026-03-12 23:48:51 +01:00
Sergey Miryanov
f105265538
GH-132042: Fix calculation of slotdef index in update_one_slot() (#145880) 2026-03-12 23:16:53 +01:00
Sam Gross
cd52172831
gh-145685: Improve scaling of type attribute lookups (gh-145774)
Avoid locking in the PyType_Lookup cache-miss path if the type's
tp_version_tag is already valid.
2026-03-12 13:30:36 -04:00
Charlie Lin
7a65900764
gh-145717: Add a few Microsoft-specific MIME types, and synchronize between mimetypes module and tests (#145718)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-03-12 18:56:07 +02:00
Tan Long
e13f6dccd7
gh-140131: Fix REPL cursor position on Windows when module completion suggestion line hits console width (GH-140333) 2026-03-12 16:59:43 +01:00
Victor Stinner
d4cc553294
gh-141510: Update PyDict C API doc for frozendict (#145533)
Mention frozendict support.
2026-03-12 15:04:36 +01:00
bkap123
17eb0354ff
gh-145446: Add critical section in functools module for PyDict_Next (GH-145487) 2026-03-12 14:46:37 +01:00
Thomas Kowalski
7836ecc5da
gh-145681: do not deallocate list buffer in _PyList_AsTupleAndClear (GH-145680)
Setting the size to 0 turns the list contents into overallocated memory that the deallocator will free.
Ownership is transferred to the new tuple so no refcount adjustment is needed.
2026-03-12 14:27:07 +01:00
Mark Shannon
453562a467
GH-145692: Convert DEOPT_IFs to EXIT_IFs (GH-145751)
* Convert DEOPT_IFs to EXIT_IFs for guards. Keep DEOPT_IF for intentional drops to the interpreter.

* Modify BINARY_OP_SUBSCR_LIST_INT and STORE_SUBSCR_LIST_INT to handle negative indices, to keep EXIT_IFs and DEOPT_IFs in different uops
2026-03-12 10:57:59 +00:00
Shamil
86a0756234
gh-140594: Fix an out of bounds read when feeding NUL byte to PyOS_StdioReadline() (#140910)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-12 10:46:36 +00:00
Serhiy Storchaka
72456309e9
gh-143715: Deprecate incomplete initialization of struct.Struct() (GH-145580)
* Struct.__new__() will require a mandatory argument (format)
* Calls of __init__() method with a different format argument on initialized
  Struct are deprecated

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2026-03-12 09:44:11 +02:00
Lysandros Nikolaou
0dce4c6eab
gh-145254: Add thread safety annotation in docs (#145255) 2026-03-12 12:18:43 +05:30
Sergey Miryanov
d19de375a2
GH-145247: Use _PyTuple_FromPair in Parser and Python (#145842)
Use _PyTuple_FromPair in Parser and Python
2026-03-11 21:08:18 +00:00
Hai Zhu
f062014d38
gh-144540: Add _MAKE_HEAP_SAFE uop to eliminate unnecessary refcount operations in RETURN_VALUE and YIELD_VALUE (GH-144414) 2026-03-11 20:24:19 +00:00
Serhiy Storchaka
77d6d5d8fc
gh-145736: Fix Tkinter tests for Tk 8.7, 9.0 and 9.1 (GH-145738) 2026-03-11 21:01:03 +02:00
Victor Stinner
713be70175
gh-141510: Raise TypeError in PyDict_SetItem() on frozendict (#145564)
If the following functions get an unexpected frozendict,
raise TypeError instead of SystemError:

* PyDict_DelItem()
* PyDict_DelItemString()
* PyDict_Merge()
* PyDict_MergeFromSeq2()
* PyDict_Pop()
* PyDict_PopString()
* PyDict_SetDefault()
* PyDict_SetDefaultRef()
* PyDict_SetItem()
* PyDict_SetItemString()
* _PyDict_SetItem_KnownHash()
* PyDict_Update()

Co-authored-by: mohsinm-dev <mohsin.mdev@gmail.com>
2026-03-11 17:05:09 +01:00
T. Wouters
706fd4ec08
gh-142183: Cache one datachunk per tstate to prevent alloc/dealloc thrashing (#145789)
Cache one datachunk per tstate to prevent alloc/dealloc thrashing when repeatedly hitting the same call depth at exactly the wrong boundary.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-03-11 15:46:16 +01:00
Bénédikt Tran
4722202a1a
gh-139933: correctly suggest attributes for classes with a custom __dir__ (GH-139950)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2026-03-11 15:30:09 +01:00
Lysandros Nikolaou
7a1da4575b
gh-142518: Improve mimalloc allocator docs (#145224) 2026-03-11 15:14:47 +01:00
Seth Michael Larson
805ca4f292
Add GitHub team for maintaining fuzzers
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-11 13:51:25 +00:00
Seth Michael Larson
42d754e34c
gh-141707: Skip TarInfo DIRTYPE normalization during GNU long name handling
Co-authored-by: Eashwar Ranganathan <eashwar@eashwar.com>
2026-03-11 13:47:55 +00:00
Sergey B Kirpichev
ce1abaf9b8
gh-99875: Document rounding mode for old-style formatting (#126382) 2026-03-11 14:25:24 +01:00
Pieter Eendebak
4f87c99a5a
gh-145376: Fix refleak & pointer type bug in uncommon code paths in Parser/ (GH-145684) 2026-03-11 14:24:15 +01:00
Thomas Kowalski
aa4240ebea
gh-145492: fix regression test for defaultdict factory repr (GH-145788) 2026-03-11 14:02:23 +01:00
Stan Ulbrych
eb9ae65e5b
Warn that overriding __builtins__ for eval is not a security mechanism (GH-145773)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2026-03-11 13:29:43 +01:00
Stefan Zetzsche
ece712197d
gh-145546: unittest.util: fix sorted_list_difference tail deduplication (GH-145547)
* fix(unittest.util): Deduplicate tail elements in sorted_list_difference

sorted_list_difference failed to deduplicate remaining elements when one
list was exhausted, causing duplicate values in the result.

Deduplicate before extending.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-03-11 13:21:22 +01:00
Shrey Naithani
5d6e8dd683
gh-145587: fix busy loop in multiprocessing.connection.wait on Windows (GH-145597)
Ensure wait() blocks for the specified timeout when object_list is empty, preventing 100% CPU usage. This aligns the Windows behavior with the Unix implementation.

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2026-03-11 13:08:48 +01:00
Sergey B Kirpichev
dae85c4d93
gh-145633: Remove support for ancient ARM platforms with mixed-endian doubles (#145634)
* Drop DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 macro.
* Use DOUBLE_IS_BIG/LITTLE_ENDIAN_IEEE754 to detect endianness of
  float/doubles.
* Drop "unknown_format" code path in PyFloat_Pack/Unpack*().

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-11 12:39:24 +01:00
Sam Gross
bdf6de8c3f
gh-145685: Avoid contention on TYPE_LOCK in super() lookups (gh-145775) 2026-03-11 07:19:32 -04:00
Cody Maloney
cf7c67b7c6
gh-101100: Fix sphinx reference warnings around I/O (#139592)
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2026-03-11 10:02:23 +02:00
Thomas Kowalski
c3955e049f
gh-145713: make bytearray.resize thread-safe on free-threading (#145714)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-03-11 12:57:26 +05:30
Hood Chatham
ebb150e76a
gh-145219: Cache Emscripten build dependencies, add install-emscripten (#145664)
Modifies the Emscripten build script to allow for caching of dependencies, and
for automated installation of new EMSDK versions.

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2026-03-11 08:43:27 +08:00
Pieter Eendebak
5197ecb5e4
gh-143050: Remove redundant decref in _PyLong_Negate (gh-143051) 2026-03-10 15:51:17 -04:00
Sam Gross
665c1db94f
gh-142763: Fix race in ZoneInfo cache eviction (gh-144978)
The cache may be cleared between the evaluation of the if statement and the
call to popitem.
2026-03-10 14:47:58 -04:00
Stan Ulbrych
4d0dce0c8d
Fix integer overflow for formats "s" and "p" in the struct module (GH-145750) 2026-03-10 18:57:34 +02:00
Sam Gross
9c1c71066e
gh-145010: Fix Python.h compilation with -masm=intel (#145011) 2026-03-10 17:55:29 +01:00
Sam Gross
f26eca7732
gh-145685: Update find_name_in_mro() to return a _PyStackRef (gh-145693) 2026-03-10 12:47:12 -04:00
Sergey B Kirpichev
c4333a1270
gh-144173: fix flaky test_complex.test_truediv() (#144355)
Previously, component-wise relative error bound was tested.  However,
such bound can't exist already for complex multiplication as one can be
used to perform subtraction of floating-point numbers, e.g. x and y for
z0=1+1j and z1=x+yj.

```pycon
>>> x, y = 1e-9+1j, 1+1j
>>> a = x*y*y.conjugate()/2;a
(1.0000000272292198e-09+1j)
>>> b = x*(y*y.conjugate()/2);b
(1e-09+1j)
>>> b == x
True
>>> (a.real-b.real)/math.ulp(b.real)
131672427.0
```
2026-03-10 17:40:51 +01:00
Benedikt Johannes
50f82d062b
gh-145044: avoid calling Py_DECREF in unsafe_object_compare on immortal objects (#145045) 2026-03-10 22:03:56 +05:30
bkap123
9e0802330c
gh-145036: Fix data race for list capacity in free-threading (#145365)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-03-10 22:00:11 +05:30