Commit graph

56795 commits

Author SHA1 Message Date
Mark Shannon
255026d9ee
GH-126910: Make _Py_get_machine_stack_pointer return the stack pointer (#147945)
* Make _Py_get_machine_stack_pointer return the stack pointer (or close to it), not the frame pointer

* Make ``_Py_ReachedRecursionLimit`` inline again
* Remove ``_Py_MakeRecCheck`` relacing its use with ``_Py_ReachedRecursionLimit``
* Move stack swtiching check into ``_Py_CheckRecursiveCall``
2026-04-01 17:15:13 +01:00
Petr Viktorin
2452324001
gh-146636: PEP 803: add Py_TARGET_ABI3T and .abi3t.so extension (GH-146637)
- Add Py_TARGET_ABI3T macro.
- Add ".abi3t.so" to importlib EXTENSION_SUFFIXES.
- Remove ".abi3.so" from importlib EXTENSION_SUFFIXES on Free Threading.
- Adjust tests

This is part of the implementation for PEP-803.
Detailed documentation to come later.

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
2026-04-01 16:14:59 +02:00
Victor Stinner
b38cfb7bca
gh-146479: Skip test_frame_pointer_unwind for gcc -O3 --enable-shared (#147947)
Skip the test if Python is built with --enable-shared and "gcc -O2"
or "gcc -O3".
2026-04-01 12:35:58 +02:00
Serhiy Storchaka
473d2a35ce
gh-147944: Increase range of bytes_per_sep (GH-147946)
Accepted range for the bytes_per_sep argument of bytes.hex(),
bytearray.hex(), memoryview.hex(), and binascii.b2a_hex()
is now increased, so passing sys.maxsize and -sys.maxsize is now
valid.
2026-04-01 08:33:30 +00:00
Serhiy Storchaka
42825e6387
gh-146431: Add the wrapcol and ignorechars parameters for more Base XX codec (GH-146434)
Add the wrapcol parameter to base64 functions b16encode(), b32encode(),
b32hexencode(), b85encode() and z85encode(), and binascii functions
b2a_base32() and b2a_base85().

Add the ignorechars parameter to base64 functions b16decode(), b32decode(),
b32hexdecode(), b85decode() and z85decode(), and binascii functions
a2b_hex(), unhexlify(), a2b_base32() and a2b_base85().
2026-04-01 10:48:50 +03:00
Stan Ulbrych
62a6e898e0
gh-147856: Allow the 'count' argument of bytes.replace() to be a keyword (#147943) 2026-03-31 19:27:52 +02:00
Sergey B Kirpichev
db5936c5b8
gh-143050: Correct PyLong_FromString() to use _PyLong_Negate() (#145901)
The long_from_string_base() might return a small integer, when the
_pylong.py is used to do conversion.  Hence, we must be careful here to
not smash it "small int" bit by using the _PyLong_FlipSign().

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-31 13:17:49 +00:00
Hugo van Kemenade
829e4d0b14
gh-141510: Support frozendict in plistlib (#145590)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-31 15:45:23 +03:00
Thomas Kowalski
b4fac15613
gh-145458: use self.skip_idle consistently in the tachyon profiler (#145459) 2026-03-31 09:57:07 +01:00
sunmy2019
72d29ea363
gh-146615: Fix crash in __get__() for METH_METHOD descriptors with invalid type argument (GH-146634) 2026-03-31 10:48:02 +03:00
Sergey B Kirpichev
e79fd60339
gh-146238: Support half-floats in the array module (#146242)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-30 19:48:34 +00:00
Serhiy Storchaka
ec2bc12e54
gh-145056: Add support for merging collections.UserDict and frozendict (GH-146465) 2026-03-30 22:07:28 +03:00
Serhiy Storchaka
727890410b
gh-145056: Fix merging of collections.OrderedDict and frozendict (GH-146466) 2026-03-30 22:06:44 +03:00
Cody Maloney
a25e09721a
gh-139633: Run netrc file permission check only once per parse (GH-139634)
Change the `.netrc` security check to be run once per parse of the
default file rather than once per line inside the file.
2026-03-30 22:05:18 +03:00
Neko Asakura
afd8113e9d
gh-144270: Make SubElement parent and tag positional-only (GH-144845)
The C accelerator implementations use PyArg_ParseTuple, which
inherently enforces positional-only parameters. The Python fallback
allowed these as keyword arguments, creating a behavioral mismatch.

Make the tag parameter of Element.__init__ and the parent and tag
parameters of SubElement positional-only to align with the C
accelerator.
2026-03-30 19:42:24 +03:00
Kumar Aditya
8e9d21c64b
gh-146558: JIT optimize dict access for objects with known hash (#146559) 2026-03-30 14:23:29 +00:00
Kumar Aditya
8e10bd77ea
gh-146587: fix type slot assignment incase of multiple slots for same name (#146593) 2026-03-30 18:07:38 +05:30
ivonastojanovic
f4d3c61f36
gh-138122: Add differential flame graph (#145785)
Differential flame graphs compare two profiling runs and highlight where
performance has changed. This makes it easier to detect regressions
introduced by code changes and to verify that optimizations have the
intended effect.

The visualization renders the current profile with frame widths
representing current time consumption. Color is then applied to show the
difference relative to the baseline profile: red gradients indicate
regressions, while blue gradients indicate improvements.

Some call paths may disappear entirely between profiles. These are
referred to as elided stacks and occur when optimizations remove code
paths or when certain branches stop executing. When elided stacks are
present, an "Elided" toggle is displayed, allowing the user to switch
between the main differential view and a view showing only the removed
paths.

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2026-03-30 12:31:06 +01:00
Sanyam Khurana
7f0c4f6a0b
gh-138577: Fix keyboard shortcuts in getpass with echo_char (#141597)
When using getpass.getpass(echo_char='*'), keyboard shortcuts like
Ctrl+U (kill line), Ctrl+W (erase word), and Ctrl+V (literal next)
now work correctly by reading the terminal's control character
settings and processing them in non-canonical mode.

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-03-30 11:11:13 +02:00
Ramin Farajpour Cami
2cf6a68f02
gh-146556: Fix infinite loop in annotationlib.get_annotations() on circular __wrapped__ (#146557) 2026-03-30 03:08:18 +00:00
Bénédikt Tran
24db78c532
gh-146080: fix a crash in SNI callbacks when the SSL object is gone (#146573) 2026-03-29 14:27:22 +02:00
Bénédikt Tran
aa6680775d
gh-146090: fix memory management of internal sqlite3 callback contexts (#146569) 2026-03-29 14:21:37 +02:00
Serhiy Storchaka
6932c3ee6a
gh-145876: Do not mask KeyErrors raised during dictionary unpacking in call (GH-146472)
KeyErrors raised in keys() or __getitem__() during dictionary unpacking
in call (func(**mymapping)) are no longer masked by TypeError.
2026-03-29 11:58:52 +03:00
Chris Eibl
1af025dd22
gh-146004: fix test_args_from_interpreter_flags on windows (#146580) 2026-03-29 09:38:45 +05:30
Pieter Eendebak
1fd66eadd2
gh-139003: Use frozenset for module level attributes in _pyrepl.utils (#139004)
Use frozenset for module level attributes
2026-03-28 20:21:19 +00:00
Stan Ulbrych
087a5f6444
_pyrepl/pager.py: call less with --clear-screen (#146382) 2026-03-28 17:23:58 +00:00
Jonathan Dung
578d726d46
gh-146544: Fix asyncio.Queue docstring ambiguity (#146545) 2026-03-28 16:35:45 +05:30
Gregory P. Smith
1efe441de7
gh-146004: propagate all -X options to multiprocessing child processes (GH-146005)
Propagate all -X command line options to multiprocessing spawned child Python processes.
2026-03-28 05:03:05 +00:00
Donghee Na
5992238986
gh-146381: Constant-fold frozendict subscript lookups via REPLACE_OPCODE_IF_EVALUATES_PURE (gh-146490) 2026-03-28 09:48:53 +09:00
Bartosz Sławecki
a5b9d60a69
gh-145059: Record lazy modules without submodules in sys.lazy_modules (#146081)
Record simple lazy modules as well
2026-03-27 14:37:11 -07:00
Bartosz Sławecki
69b08c397b
gh-145057: Fix test names and comments to reflect sys.lazy_modules is a dict, not a set (#146084)
Fix test names and comments to reflect sys.lazy_modules is a dict, not a set
2026-03-27 14:35:50 -07:00
Imgyu Kim
73cc1fd4f4
gh-146310: Fix ensurepip to treat empty WHEEL_PKG_DIR as unset (#146357)
Path('') resolves to CWD, so an empty WHEEL_PKG_DIR string caused
ensurepip to search the current working directory for wheel files.
Add a truthiness check to treat empty strings the same as None.

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-27 20:48:07 +00:00
Neko Asakura
a492d9ff74
gh-145866: Convert LIST_EXTEND to leave its inputs on the stack to be cleaned up by _POP_TOP be cleaned up by _POP_TOP (GH-146383) 2026-03-28 01:04:17 +08:00
moktamd
1417737810
gh-146507: cache the buffer size for SelectorTransport.get_write_buffer_size() (#146518) 2026-03-27 21:43:15 +05:30
Pieter Eendebak
9214e3f33e
gh-123471: Make itertools.zip_longest safe in the FT build (#146033) 2026-03-27 19:31:49 +05:30
Brij Kapadia
0de4e08a59
gh-146250: Fix memory leak in re-initialization of SyntaxError (#146251) 2026-03-27 19:29:21 +05:30
Victor Stinner
d4153a9f76
gh-146480: Override the exception in _PyErr_SetKeyError() (#146486)
If _PyErr_SetKeyError() is called with an exception set, it now
replaces the current exception with KeyError (as expected), instead
of setting a SystemError or failing with a fatal error (in debug
mode).
2026-03-27 11:20:19 +00:00
Joao S. O. Bueno
d0061d50b0
gh-146440: Add array_hook parameter to JSON decoders (#146441)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-27 11:10:48 +00:00
Sergey B Kirpichev
256907d3aa
gh-138580: Revert sys.float_info.iec_60559 boolean flag (#146501)
This reverts commit 68c7fad757.

It looks like on practice the __STDC_IEC_559__ doesn't indicate
conformance to the standard. It can't be used to filter out tests
or to give some promises in documentation. See discussion in
the reverted PR thread:
https://github.com/python/cpython/pull/138811#issuecomment-4117692418
2026-03-27 11:29:15 +01:00
Victor Stinner
0c7a75aeef
gh-146059: Cleanup pickle fast_save_enter() test (#146481)
Remove {"key": data}, it's not required to reproduce the bug.
Simplify also deep_nested_struct(): remove the seed parameter.
Fix a typo in a comment.
2026-03-27 09:13:48 +01:00
Victor Stinner
5c0dcb3e0d
gh-146059: Call fast_save_leave() in pickle save_frozenset() (#146173)
Add more pickle tests: test also nested structures.
2026-03-26 17:35:27 +01:00
Sergey B Kirpichev
0e3b3b895c
gh-146151: Add support for complex arrays in the array module (#146237)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-26 15:45:20 +01:00
Sergey B Kirpichev
c68a19448a
gh-146151: memoryview supports 'F' and 'D' format types (complex) (#146241)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-26 15:26:34 +01:00
Kumar Aditya
bfdaa3c565
gh-131798: JIT: split call method and call builtin opcodes into smaller uops (#146463) 2026-03-26 14:20:57 +00:00
Serhiy Storchaka
0e543055b0
gh-145876: Do not mask AttributeErrors raised during dictionary unpacking (GH-145906)
AttributeErrors raised in keys() or __getitem__() during
dictionary unpacking ({**mymapping} or func(**mymapping)) are
no longer masked by TypeError.
2026-03-26 13:48:57 +00:00
Jack Danger
e1d4823797
gh-145650: Add logging.{Formatter,Filter}.__repr__ (GH-145652) 2026-03-26 12:41:14 +00:00
Robert Kirkman
3a2b81e919
gh-145616: Detect Android sysconfig ABI correctly on 32-bit ARM Android on 64-bit ARM kernel (GH-145617)
When Python is running on 32-bit ARM Android on a 64-bit ARM kernel, `os.uname().machine` is `armv8l`. Such devices run the same userspace code as `armv7l` devices, so apply the same `armeabi_v7a` Android ABI to them, which works.
2026-03-26 13:27:36 +01:00
Sacul
1516c26399
gh-145866: Convert DICT_UPDATE to leave its inputs on the stack to be cleaned up by _POP_TOP (GH-146190) 2026-03-26 19:38:44 +08:00
Victor Stinner
8de70b31c5
gh-145633: Fix struct.pack('f') on s390x (#146422)
Use PyFloat_Pack4() to raise OverflowError.
Add more tests on packing/unpacking floats.

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2026-03-26 11:12:49 +00:00
Kumar Aditya
fc1f6b176e
gh-GH-131798: optimize jit attribute loads on immutable types (#146449) 2026-03-26 10:12:10 +00:00