Commit graph

56813 commits

Author SHA1 Message Date
Donghee Na
289f19adb0
gh-148083: Constant-fold _CONTAINS_OP_SET for frozenset (gh-148084) 2026-04-04 12:32:12 +00:00
Stan Ulbrych
fe9befc1ca
gh-145883: Fix two heap-buffer-overflows in _zoneinfo (#145885) 2026-04-04 13:29:17 +01:00
Kumar Aditya
e7bf8eac0f
gh-131798: split recursion check to _CHECK_RECURSION_LIMIT and combine checks (GH-148070) 2026-04-04 17:23:03 +08:00
Serhiy Storchaka
113038f940
gh-148016: Improve "Leading padding not allowed" error in Base32 and Base64 decoders (GH-148017)
It is now raised instead of "Excess padding not allowed" if all characters
preceding "=" were ignored.
2026-04-04 08:37:14 +00:00
Serhiy Storchaka
985216ced3
gh-148029: Fix error message for invalid number of Base32 characters (GH-148030)
Do not count ignored non-alphabet characters.
2026-04-04 11:07:19 +03:00
Kumar Aditya
7e275d4965
gh-131798: JIT inline function addresses of builtin methods (#146906) 2026-04-04 09:12:13 +05:30
Robert Kirkman
848bbe9ff2
gh-146541: Allow building the Android testbed for 32-bit targets (#146542)
Allows building the Android testbed for 32-bit targets, adding the target triplets
`arm-linux-androideabi` and `i686-linux-android`.

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2026-04-04 11:27:27 +08:00
Łukasz Langa
3681d47a44
gh-143930: Tweak the exception message and increase test coverage (GH-146476) 2026-04-03 17:31:25 +02:00
Pieter Eendebak
48317feec8
gh-146640: Optimize int operations by mutating uniquely-referenced operands in place (JIT only) (GH-146641) 2026-04-03 23:23:04 +08:00
Jakub Kulík
3908593039
test_copy_dir_no_read_permission requires non root user (GH-148028)
This fixes a bug introduced in commit 86b8617747
(GH-146195).
2026-04-03 10:47:59 +02:00
Miikka Koskinen
f3b74d6269
gh-80642: timeit - make target time of autorange configurable (#140283)
Co-authored-by: Alessandro Cucci <alessandro.cucci@gmail.com>
Co-authored-by: blurb-it[bot] <blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-04-03 06:47:21 +00:00
Jakub Kulík
86b8617747
Move root user checks to test.support (#146195) 2026-04-02 15:50:38 +00:00
Petr Viktorin
9b08f8c56f
GH-126910: Revert "Make _Py_get_machine_stack_pointer return the stack pointer (#147945)" (GH-147994)
Revert "GH-126910: Make `_Py_get_machine_stack_pointer` return the stack pointer (#147945)"

This reverts commit 255026d9ee,
which broke a tier-1 buildbot.
2026-04-02 16:53:09 +02:00
Ma Yukun
fc7a188fe7
gh-146613: Fix re-entrant use-after-free in itertools._grouper (#147962) 2026-04-02 19:04:58 +05:30
Victor Stinner
c1a4112c22
gh-147988: Initialize digits in long_alloc() in debug mode (#147989)
When Python is built in debug mode:

* long_alloc() now initializes digits with a pattern to detect usage of
  uninitialized digits.
* _PyLong_CompactValue() now makes sure that the digit is zero when the
  sign is zero.
* PyLongWriter_Finish() now raises SystemError if it detects uninitialized
  digits

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-04-02 11:55:34 +00:00
Petr Viktorin
a86963b3e2
gh-146636: Py_mod_abi mandatory for modules created from slots array (GH-146855) 2026-04-02 13:54:21 +02:00
Victor Stinner
97babb8ef7
gh-143394: Skip pyrepl test_no_newline() basic REPL if readline is missing (#147973) 2026-04-02 13:45:59 +02:00
Locked-chess-official
c32e264227
gh-146656: properly raise NotImplementedError instead of NotImplemented in test_discover (#146661)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Filipe Laíns <filipe.lains@gmail.com>
2026-04-01 22:54:06 +00:00
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