Commit graph

56580 commits

Author SHA1 Message Date
Sergey B Kirpichev
f3a381e54f
gh-141510: support frozendict's in the C decimal module (gh-145165) 2026-02-27 07:02:39 +09:00
Serhiy Storchaka
812ef66759
gh-145202: Fix crash in unicodedata's GraphemeBreakIterator and Segment (GH-145216)
Remove the tp_clear slots and make Segment members read-only.

Also add tests for reference loops involving GraphemeBreakIterator
and Segment.
2026-02-26 11:30:08 +02:00
Hai Zhu
277a03711b
gh-145197: Fix JIT trace crash when recording function from cleared generator frame (GH-145220) 2026-02-25 16:52:53 +00:00
Filipe Laíns
56b7dc4e9b
Fix compileall in lazy imports test data with bad syntax (#145221) 2026-02-25 16:27:53 +00:00
Filipe Laíns
80b2b88338
Fix "lazy from (...) import (...)" tests (#145213) 2026-02-25 15:57:06 +00:00
Tadej Magajna
12828e5f98
gh-85809: Ensure shutil.make_archive accepts path-like objects in all cases (GH-143668) 2026-02-25 16:44:17 +02:00
Matthias Kievernagel
f8ce51a522
gh-47655: Add support for user data and detail of Tk events to tkinter (GH-7142)
Expose the %d substitution as the tkinter.Event attributes:

* "detail" for Enter, Leave, FocusIn, FocusOut, and ConfigureRequest events
* "user_data" for virtual events

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-02-25 10:34:00 +02:00
Filipe Laíns
1ac9d138ae
GH-145006: add ModuleNotFoundError hints when a module for a differen… (#145007)
* GH-145006: add ModuleNotFoundError hints when a module for a different ABI exists

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Fix deprecation warnings

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Use SHLIB_SUFFIX in test_find_incompatible_extension_modules when available

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Add test_incompatible_extension_modules_hint

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Fix Windows

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Show the whole extension module file name in hint

Signed-off-by: Filipe Laíns <lains@riseup.net>

---------

Signed-off-by: Filipe Laíns <lains@riseup.net>
2026-02-25 00:53:01 +00:00
rueteh
4e45c9c309
gh-136677: Introduce executable specific linker flags to configure (#137296)
* introduce executable specific linker flags

Add PY_CORE_EXE_LDFLAGS and EXE_LDFLAGS which stores executable specific
LDFLAGS, replacing PY_CORE_LDFLAGS for building
executable targets.

If PY_CORE_EXE_LDFLAGS / EXE_LDFLAGS is not provided, then it defaults
to the value of PY_CORE_LDFLAGS which is the existing behaviour.

If both flags are supplied, and there is a need
to distinguish between executable and shared specific LDFLAGS,
in particular, PY_CORE_LDFLAGS should contain the shared specific LDFLAGS.

* documentation for new linker flags

* update Misc folder documentation

* Update Makefile.pre.in

Co-authored-by: Victor Stinner <vstinner@python.org>

---------

Co-authored-by: Filipe Laíns <filipe.lains@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Filipe Laíns <lains@riseup.net>
2026-02-24 22:52:02 +00:00
Stan Ulbrych
5e61a16c10
gh-145187: Fix crash on invalid type parameter bound expression in conditional block (GH-145188)
Fix parsing crash found by oss-fuzz
2026-02-24 12:44:57 -08:00
Stan Ulbrych
56c4f10d6e
gh-88091: Fix unicodedata.decomposition() for Hangul Syllables (GH-144993) 2026-02-24 19:42:33 +02:00
Bartosz Sławecki
97181bb336
gh-143535: Dispatch on the second argument if generic method is instance-bindable (GH-144615)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2026-02-24 17:04:37 +01:00
Donghee Na
0f759f1171
gh-145122: Add _GUARD_NOS_ANY_DICT to prevent STORE_SUBSCR_DICT on frozendict (gh-145039) 2026-02-25 00:48:45 +09:00
Bartosz Sławecki
4c95ad8e49
Fix inspect.Parameter docstring on the kind attribute (GH-143541) 2026-02-24 13:17:45 +01:00
Arjit Singh Grover
27ded24348
gh-143304: Fix ctypes.CDLL to honor handle parameter on POSIX systems (GH-143318)
The handle parameter was being ignored in the POSIX implementation
of CDLL._load_library(), causing it to always call _dlopen() even
when a valid handle was provided. This was a regression introduced
in recent refactoring.
2026-02-24 13:16:58 +01:00
Serhiy Storchaka
d6a71f4690
gh-137335: Fix unlikely name conflicts for named pipes in multiprocessing and asyncio on Windows (#137389)
Since os.stat() raises an OSError for existing named pipe "\\.\pipe\...",
os.path.exists() always returns False for it, and tempfile.mktemp() can
return a name that matches an existing named pipe.

So, tempfile.mktemp() cannot be used to generate unique names for named
pipes. Instead, CreateNamedPipe() should be called in a loop with
different names until it completes successfully.
2026-02-24 13:27:49 +02:00
Serhiy Storchaka
ca66d3c40c
gh-66305: Fix a hang on Windows in the tempfile module (GH-144672)
It occurred when trying to create a temporary file or subdirectory in
a non-writable directory.
2026-02-24 13:05:06 +02:00
Stan Ulbrych
fd0400585e
_struct.c: Fix UB from integer overflow in prepare_s (GH-145158)
Avoid possible undefined behaviour from signed overflow in `struct` module

As discovered via oss-fuzz.
2026-02-23 16:53:17 -08:00
Philipp A.
ae7fc4a4f6
gh-110937: Document full public importlib.metadata.Distribution API (#143480) 2026-02-23 18:51:03 -05:00
Stan Ulbrych
1dfbde9299
gh-145118: Add frozendict support to str.maketrans() (gh-145129)
Add support to `str.maketrans`
2026-02-23 16:04:16 -06:00
Raymond Hettinger
c7d7105b8d
Indexing is more straight-forward (and faster) than unpacking (gh-145154) 2026-02-23 12:31:35 -06:00
Sam Gross
8db8fc9b51
gh-144777: Fix data races in IncrementalNewlineDecoder (gh-144971) 2026-02-23 09:32:16 -05:00
Victor Stinner
3dc8fdb321
gh-145089: Fix frozendict constructor (#145128) 2026-02-23 08:22:29 +01:00
Gregory P. Smith
ad4ee7cb0f
gh-144015: Add portable SIMD optimization for bytes.hex() et. al. (GH-143991)
Add SIMD optimization for `bytes.hex()`, `bytearray.hex()`, and `binascii.hexlify()` as well as `hashlib` `.hexdigest()` methods using platform-agnostic GCC/Clang vector extensions that compile to native SIMD instructions on our [PEP-11 Tier 1 Linux and macOS](https://peps.python.org/pep-0011/#tier-1) platforms.

- 1.1-3x faster for common small data (16-64 bytes, covering md5 through sha512 digest sizes)
- Up to 11x faster for large data (1KB+)
- Retains the existing scalar code for short inputs (<16 bytes) or platforms lacking SIMD instructions, no observable performance regressions there.

## Supported platforms:

- x86-64: the compiler generates SSE2 - always available, no flags or CPU feature checks needed
- ARM64: NEON is always available, always available, no flags or CPU feature checks needed
- ARM32: Requires NEON support and that appropriate compiler flags enable that (e.g., `-march=native` on a Raspberry Pi 3+) - while we _could_ use runtime detection to allow neon when compiled without a recent enough `-march=` flag (`cortex-a53` and later IIRC), there are diminishing returns in doing so. Anyone using 32-bit ARM in a situation where performance matters will already be compiling with such flags. (as opposed to 32-bit Raspbian compilation that defaults to aiming primarily for compatibility with rpi1&0 armv6 arch=armhf which lacks neon)
- Windows/MSVC: Not supported. MSVC lacks `__builtin_shufflevector`, so the existing scalar path is used. Leaving it as an opportunity for the future for someone to figure out how to express the intent to that compiler.

This is compile time detection of features that are always available on the target architectures. No need for runtime feature inspection.
2026-02-22 19:19:03 -08:00
dgpb
79f6caf8f1
gh-145131: difflib.Differ._fancy_replace performance (re-use ratio) (#145133)
re-use calculated ratio
2026-02-22 19:59:40 -06:00
Hai Zhu
fd01372d4e
gh-145064: Fix JIT assertion failure during CALL_ALLOC_AND_ENTER_INIT side exit (GH-145100) 2026-02-22 18:46:03 +00:00
Victor Stinner
2be2dd5fc2
gh-145076: Check globals type in __lazy_import__() (#145086) 2026-02-21 22:06:59 +01:00
Victor Stinner
fbd3b25e00
gh-141510: Change dict_unhashable_type() error message for frozendict (#145085) 2026-02-21 20:08:28 +01:00
Victor Stinner
25fc04d041
gh-141510: Test frozendict in test_capi.test_dict (#145084)
Complete PyDict_Clear() documentation.
2026-02-21 20:07:30 +01:00
Victor Stinner
c9380aebbe
gh-141510: Check argument in PyDict_Contains() (#145083)
PyDict_Contains() and PyDict_ContainsString() now fail with
SystemError if the first argument is not a dict, frozendict, dict
subclass or frozendict subclass.
2026-02-21 18:36:02 +01:00
Stan Ulbrych
f1f61bf872
gh-66802: Add unicodedata.block() function (#145042)
Closes #66802
2026-02-21 18:27:55 +01:00
Victor Stinner
6940c1dc0c
gh-141510: Check argument in PyDict_MergeFromSeq2() (#145082)
PyDict_MergeFromSeq2() now fails with SystemError if the first
argument is not a dict or a dict subclass.

PyDict_Update(), PyDict_Merge() and _PyDict_MergeEx() no longer
accept frozendict.
2026-02-21 17:21:43 +01:00
Victor Stinner
770d354549
gh-141510: Support frozendict in pprint (#144908)
Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
2026-02-21 17:08:24 +01:00
Victor Stinner
9e083b57ee
gh-141510: Test frozendict C API (#145081)
Add tests on functions:

* PyAnyDict_Check()
* PyAnyDict_CheckExact()
* PyFrozenDict_Check()
* PyFrozenDict_CheckExact()
* PyFrozenDict_New()
2026-02-21 17:00:23 +01:00
Victor Stinner
646bd86e3b
gh-141510: Fix copy.deepcopy() for recursive frozendict (#145027) 2026-02-21 15:30:40 +00:00
Raymond Hettinger
7258dbc518
Use lazy imports in collections (gh-145054) 2026-02-21 08:14:53 -06:00
Stan Ulbrych
e1bd0cd37b
gh-145058: Add input validation to _PyImport_LazyImportModuleLevelObject (#145068) 2026-02-21 12:52:40 +00:00
Victor Stinner
2133e16bfe
gh-141510: Fix test_xpickle for Python 3.14 and older (#145069)
Skip tests on frozendict on Python 3.14 and older.
2026-02-21 13:05:35 +01:00
Bénédikt Tran
3a2a686cc4
gh-142516: fix reference leaks in ssl.SSLContext objects (#143685) 2026-02-21 12:31:16 +01:00
Victor Stinner
7b0bd9eb91
gh-141510, PEP 814: Add frozendict support to json (#144903) 2026-02-21 12:22:47 +01:00
Bénédikt Tran
347fc438cf
gh-143698: correctly check scheduler and setpgroup values for os.posix_spawn[p] (#143699)
Fix an issue where passing invalid arguments to `os.posix_spawn[p]` functions
raised a SystemError instead of a TypeError, and allow to explicitly use `None`
for `scheduler` and `setpgroup` as specified in the docs.
2026-02-21 11:20:42 +00:00
Victor Stinner
20b1535ca4
gh-141510, PEP 814: Add frozendict support to pickle (#144967)
Add frozendict.__getnewargs__() method.
2026-02-21 11:07:55 +01:00
Rafael Santos
273d5062ca
gh-145028: Fix blake2 tests in test_hashlib when it is missing due to build config (GH-145029)
specifically configure --without-builtin-hashlib-hashes means the otherwise guaranteed available blake2 family will not exist.  this allows the test suite to still pass.
2026-02-20 20:57:29 -08:00
Sam Gross
70da972f97
gh-144809: Make deque copy atomic in free-threaded build (gh-144966) 2026-02-20 14:31:58 -05:00
Alper
a56532771a
gh-144981: Make PyUnstable_Code_SetExtra/GetExtra thread-safe (#144980)
* Make PyUnstable_Code_SetExtra/GetExtra thread-safe
2026-02-20 10:52:18 -08:00
Anton Ryzhov
175ab31377
Update comments in _strptime module (GH-144979)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-20 08:56:56 +01:00
J Berg
4141f0a1ee
Correct MAX_N in Lib/zipfile ZipExtFile (GH-144973)
"<<" has lower precedence than "-".
2026-02-20 00:48:01 +02:00
Robsdedude
0f7cd5544a
gh-144156: Fix email header folding concatenating encoded words (#144692)
The fix for gh-92081 (gh-92281) was unfortunately flawed, and broke whitespace handling for encoded word patterns that had previously been working correctly but had no corresponding tests, unfortunately in a way that made the resulting headers not RFC compliant, in such a way that Yahoo started rejecting the resulting emails.  This fix was released in 3.14 alpha 1, 3.13 beta 2 and 3.12.5.   This PR fixes the original problem in a way that does not break anything, and in fact fixes a small pre-existing bug (a spurious whitespace after the ':' of the header label if the header value is immediately wrapped on to the next line).  (RDM)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: R. David Murray <rdmurray@bitdance.com>
2026-02-19 13:29:05 -05:00
Stan Ulbrych
930b3fd1df
compute-changes.py: Fix & test process_changed_files() (#144674)
Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2026-02-19 18:49:34 +02:00
Filipe Laíns
f282f7aed9
GH-134872: add ModuleNotFoundError suggestions (#142512)
* gh-134872: Add traceback suggestions for ModuleNotFoundError

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Add news

Signed-off-by: Filipe Laíns <lains@riseup.net>

---------

Signed-off-by: Filipe Laíns <lains@riseup.net>
2026-02-19 16:10:58 +00:00