Commit graph

15619 commits

Author SHA1 Message Date
Pieter Eendebak
f9dac4e2eb
gh-145376: Avoid reference leaks in failure path of _functoolsmodule.c method partial_new (GH-145423) 2026-03-04 14:32:14 +01:00
Pieter Eendebak
3fe7849d9a
gh-145376: Fix refleak in error path of time_tzset (GH-145477) 2026-03-04 14:21:10 +01:00
Jelle Zijlstra
bd13cc09fa
gh-145376: Fix various reference leaks (GH-145377) 2026-03-03 16:23:30 +01:00
bkap123
671a953dd6
gh-144475: Fix reference management in partial_repr (GH-145362) 2026-03-03 13:46:02 +00:00
Victor Stinner
52c8efa87d
gh-145335: Fix os functions when passing fd -1 as path (#145439)
os.listdir(-1) and os.scandir(-1) now fail with OSError(errno.EBADF)
rather than listing the current directory.

os.listxattr(-1) now fails with OSError(errno.EBADF) rather than
listing extended attributes of the current directory.
2026-03-03 13:57:08 +01:00
Stan Ulbrych
a929e80b9e
Add PyExc_OverflowError to the list of possible exceptions in fuzz_ast_literal_eval fuzzer (GH-145429) 2026-03-03 13:10:34 +01:00
Filipe Laíns
46c5c57226
GH-145273: skip stdlib warning on module_search_paths_set (#145442) 2026-03-02 21:11:27 +00:00
Filipe Laíns
539a985fac
GH-145273: drop build_prefix check from missing stdlib warning (#145437) 2026-03-02 20:23:22 +00:00
Filipe Laíns
3ab39d2308
GH-145273: warn when we can't find the standard library (#145274) 2026-03-02 18:51:45 +00:00
AN Long
5c3a47b94a
gh-145335: Fix crash when passing -1 as fd in os.pathconf (#145390)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-03-02 19:07:49 +01:00
Hai Zhu
107863ee17
gh-144569: Avoid creating temporary objects in BINARY_SLICE for list, tuple, and unicode (GH-144590)
* Scalar replacement of BINARY_SLICE for list, tuple, and unicode
2026-03-02 17:02:38 +00:00
zhong
b611db491d
gh-142781: Fix type confusion in zoneinfo weak cache (GH-142925)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-02 13:30:38 +01:00
Petr Viktorin
3b276f3f59
gh-144748: Make PyErr_CheckSignals raise the exception scheduled by PyThreadState_SetAsyncExc (GH-145178)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-03-02 11:47:32 +01:00
Sam Gross
72eca2af59
gh-145230: Update lockbench (gh-145231)
Remove PyThread_type_lock (now uses PyMutex internally).

Add new benchmark options:
- work_inside/work_outside: control work inside and outside the critical section to vary contention levels
- num_locks: use multiple independent locks with threads assigned round-robin
- total_iters: fixed iteration count per thread instead of time-based, useful for measuring fairness
- num_acquisitions: lock acquisitions per loop iteration
- random_locks: acquire random lock each iteration

Also return elapsed time from benchmark_locks() and switch lockbench.py to use argparse.
2026-02-27 14:09:05 -05:00
莯凛
171e0facc4
gh-123853: Cleanup Windows 95 locale fallback support (#144738)
Closes #123853
2026-02-27 11:06:46 +01:00
Serhiy Storchaka
6ea84b2726
Fix unlikely potential reference leak in _locale._getdefaultlocale (GH-145250)
It occurs in a code which perhaps never executed.
2026-02-27 08:02:19 +00:00
A.Ibrahim
06b0920f12
gh-142787: Handle empty sqlite3 blob slices (#142824) 2026-02-26 23:40:25 +00:00
Sergey B Kirpichev
f3a381e54f
gh-141510: support frozendict's in the C decimal module (gh-145165) 2026-02-27 07:02:39 +09:00
Taegyun Kim
c2d3d6b0dd
gh-144316: Fix missing exception in _remote_debugging with debug=False (#144442) 2026-02-26 21:14:34 +00: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
Stan Ulbrych
56c4f10d6e
gh-88091: Fix unicodedata.decomposition() for Hangul Syllables (GH-144993) 2026-02-24 19:42:33 +02: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
Serhiy Storchaka
b32c830d44
gh-101178: Fix possible integer overflow in Ascii85 encoder with wrapcol=1 (GH-144778)
It could happen if the size of the input is more than 4/5 of sys.maxsize
(only feasible on 32-bit platforms).

Also simplify the integer overflow checks in the Base64 encoder, and
harmonize them with the code for Ascii85 and Base85.
2026-02-24 11:40:24 +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
Sam Gross
8db8fc9b51
gh-144777: Fix data races in IncrementalNewlineDecoder (gh-144971) 2026-02-23 09:32:16 -05:00
Chris Eibl
5944a539b9
Fix warnings on main (GH-145104) 2026-02-22 19:02:15 +08: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
Stan Ulbrych
f1f61bf872
gh-66802: Add unicodedata.block() function (#145042)
Closes #66802
2026-02-21 18:27:55 +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
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
Sam Gross
70da972f97
gh-144809: Make deque copy atomic in free-threaded build (gh-144966) 2026-02-20 14:31:58 -05:00
Shamil
50c14719fb
gh-144986: Fix memory leak in atexit.register() (#144987) 2026-02-19 20:42:55 +00:00
Petr Viktorin
f1cf762ee7
gh-84393: Remove AIX workaround: re-enable posix_fadvise and f_allocate (GH-144784)
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
2026-02-19 15:11:21 +01:00
Mark Shannon
3f37b94c73
GH-144651: Optimize the new uops added when recording values during tracing. (GH-144948)
* Handle dependencies in the optimizer, not the tracer
* Strengthen some checks to avoid relying on optimizer for correctness
2026-02-19 11:52:57 +00:00
Donghee Na
3e2f5c133f
gh-141510: Update specializer to support frozendict (gh-144949) 2026-02-19 01:10:53 +09:00
Serhiy Storchaka
a18e0fa4c0
gh-135573: Add tests for pickle opcodes with wrong types (GH-144950)
Ensure that APPENDS and ADDITEMS raise error for wrong collection even
with empty items.
2026-02-18 18:02:12 +02:00
Serhiy Storchaka
3f50432e31
gh-140652: Fix a crash in _interpchannels.list_all() after closing a channel (ПР-143743) 2026-02-18 14:54:48 +02:00
Serhiy Storchaka
7ac0868708
gh-135573: Make pickled lists, sets and dicts a tiny bit smaller (GH-144162)
Ensure that APPENDS and SETITEMS are never used for a batch of size 1.
Ensure that ADDITEMS and SETITEMS are never used for a batch of size 0.

This harmonizes the C implementation with the Python implementation
which already guarantees this and makes a pickle a tiny bit smaller
with a tiny chance (about 0.1%).

Saves 1 byte for list and dict with size 1001, 2001, ...
Saves 2 bytes for set and dict with size 1000, 2000, ...
2026-02-18 13:20:31 +02:00
Serhiy Storchaka
767b4d02e2
gh-144882: Optimize name tables in unicodedata by excluding names derived by rule NR2 (GH-144883)
Since the code for rule NR2 is already here, to support CJK unified
ideographs and Tangut ideographs, it can also be used for other names
derived by rule NR2.
2026-02-18 12:58:21 +02:00
Stan Ulbrych
e49bfca87c
gh-142224: unicodedata: support bidi classes for unassigned code points (GH-144815) 2026-02-18 12:54:07 +02:00
Serhiy Storchaka
8b7b5a9946
gh-80667: Fix Tangut ideographs names in unicodedata (GH-144789)
Co-authored-by: Pierre Le Marre <dev@wismill.eu>
2026-02-16 13:31:18 +02:00
Ramin Farajpour Cami
c91638ca06
gh-144833: Fix use-after-free in SSL module when SSL_new() fails (GH-144843)
In newPySSLSocket(), when SSL_new() returns NULL, Py_DECREF(self)
was called before _setSSLError(get_state_ctx(self), ...), causing
a use-after-free. Additionally, get_state_ctx() was called with
self (PySSLSocket*) instead of sslctx (PySSLContext*), which is
a type confusion bug.

Fix by calling _setSSLError() before Py_DECREF() and using
sslctx instead of self for get_state_ctx().
2026-02-15 18:43:07 -08:00
Gregory P. Smith
300de1e98a
gh-86519: Add prefixmatch APIs to the re module (GH-31137)
Adds `prefixmatch` APIs to the re module as an alternate name for our long existing `match` APIs to help alleviate a common Python confusion for those coming from other languages regular expression libraries.

These alleviate common confusion around what "match" means as Python is different than other popular languages regex libraries in our use of the term as an API name.  The original `match` names are **NOT being deprecated**.  Source tooling like linters, IDEs, and LLMs could suggest using `prefixmatch` instead of match to improve code health and reduce cognitive burden of understanding the intent of code when configured for a modern minimum Python version.

See the documentation changes for a better description.

Discussions took place in the PR, in the issue, and finally at https://discuss.python.org/t/add-re-prefixmatch-deprecate-re-match/105927

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 17:43:39 -08:00
Zachary Ware
b933ef9261
gh-144551: Update CI to use latest OpenSSL versions (GH-144794)
Also update _ssl_data_36.h to include an added symbol from 3.6.1.
2026-02-13 13:06:07 -06:00
Priyanshu Singh
82b92e3cd1
gh-143637: Fix re-entrant mutation of ancillary data in socket.sendmsg() (#143892)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-02-13 16:35:08 +01:00
James
e66f4a5a9c
gh-80667: Fix case-sensitivity of some Unicode literal escapes (GH-107281)
Lookup for CJK ideograms and Hangul syllables is now case-insensitive,
as is the case for other character names.
2026-02-12 18:50:40 +02:00
Stan Ulbrych
51a408ed77
Add missing step to Modules/expat/refresh.sh instructions (GH-144719) 2026-02-12 09:55:26 +01:00
Pablo Galindo Salgado
46d5106cfa
gh-142349: Implement PEP 810 - Explicit lazy imports (#142351)
Co-authored-by: T. Wouters <twouters@meta.com >
Co-authored-by: Brittany Reynoso <breynoso@meta.com>
Co-authored-by: Dino Viehland <dinoviehland@meta.com>
2026-02-12 00:15:33 +00:00