Commit graph

15857 commits

Author SHA1 Message Date
Serhiy Storchaka
287c98f4cb
gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
Serhiy Storchaka
a5cb7c34dd
gh-150285: Fix too long docstrings in the os module (GH-150296) 2026-05-24 15:04:01 +03:00
Serhiy Storchaka
9da7923835
gh-150285: Fix too long docstrings in the pyexpat module (GH-150294) 2026-05-24 15:03:45 +03:00
Serhiy Storchaka
9fceb1c0c5
gh-150285: Fix too long docstrings in the zstd module (GH-150291) 2026-05-24 15:03:22 +03:00
Serhiy Storchaka
0466560b31
gh-150285: Fix too long docstrings in the sqlite3 module (GH-150290) 2026-05-24 15:02:58 +03:00
Serhiy Storchaka
cdc499ae77
gh-150285: Fix too long docstrings in the _remote_debugging module (GH-150289) 2026-05-24 15:02:43 +03:00
Serhiy Storchaka
6bed57a3b6
gh-150285: Fix too long docstrings in the decimal module (GH-150288) 2026-05-24 15:02:32 +03:00
Serhiy Storchaka
160dc74122
gh-150285: Fix too long docstrings in the io module (GH-150287) 2026-05-24 15:02:21 +03:00
Serhiy Storchaka
4c0fe2d134
gh-150285: Fix too long docstrings in the curses module (GH-150286) 2026-05-24 15:02:12 +03:00
Pieter Eendebak
dfeeee990b
gh-145192: improve performance of PySequence_GetSlice (#145193) 2026-05-23 15:45:50 +05:30
Kumar Aditya
e8545ed3ea
gh-149816: add missing critical section on self in buffered_iternext (#150295) 2026-05-23 08:57:13 +00:00
Victor Stinner
a7d5a6cc17
gh-150114: Log the memory usage in regrtest on Windows (#150267)
Add _winapi.GetProcessMemoryInfo() function.

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2026-05-23 00:04:51 +02:00
Victor Stinner
b770b2350e
Revert "gh-146452: Improve locking granularity in pickle's batch_dict_exact and fix race condition (#150025)" (#150261)
This reverts commit 57a0e570d3.
2026-05-22 22:22:47 +02:00
Victor Stinner
e020836fd4
gh-149879: Fix test_capi on Cygwin (#150252)
Fix Test_Pep523AllowSpecialization tests of test_capi.test_misc.

On Cygwin, _PyEval_EvalFrameDefault in _testinternalcapi is not the
same as _PyEval_EvalFrameDefault in python.exe. So pass NULL
explicitly to use the default function (_PyEval_EvalFrameDefault).
2026-05-22 21:47:32 +02:00
Victor Stinner
8115360153
gh-149879: Fix test_c_stack_unwind on Cygwin (#150084)
On Cygwin, the Python library is called "cygpython3.16.dll".
2026-05-22 21:32:44 +02:00
Pablo Galindo Salgado
661df25692
gh-149584: Fix excessive overhead in the Tachyon profiler regarding the cache behavior (#149649)
Use exact remote reads for interpreter state, thread state, and
interpreter frame structs instead of pulling full remote pages into the
profiler page cache. This matches the core change from
python/cpython#149585.

The profiler clears the page cache between samples, so live entries are
always packed at the front. Track the live count and only clear/search
that prefix instead of scanning all 1024 slots on the hot path.

Use the frame cache to predict the next thread state and top frame
address, then batch interpreter/thread/frame reads with process_vm_readv
when profiling a Linux target. Reuse prefetched frame buffers in the
frame walker when the prediction is valid.

Cache the last FrameInfo tuple per code object/instruction offset, reuse
cached thread id objects, and append cached parent frames directly on
full frame-cache hits. This cuts Python allocation churn in the
steady-state profiler path.
2026-05-20 04:32:08 -07:00
Pablo Galindo Salgado
1f3c2679f1
gh-149321: Remove lazy_imports=none startup mode (#149389) 2026-05-19 16:01:15 -07:00
larryhastings
79088e0d82
gh-150042: queue.SimpleQueue.put: fix minor refleak. (GH-150043)
If queue.SimpleQueue.put can't handoff the item to a
waiting thread, and fails to allocate memory when adding
the item to a ringbuf, it would leak a reference.  Fixed.
2026-05-20 00:27:04 +02:00
Alexey Katsman
d095ceb0f4
gh-149816: Fix UAF in Modules/_pickle.c (GH-150024)
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-05-20 00:11:17 +02:00
AN Long
3d2aa899ba
gh-149983: Fix PyErr_NoMemory call without GIL in winconsoleio.c (GH-149984) 2026-05-19 22:31:00 +02:00
Kirill Ignatev
8b31d08e62
gh-149816: Fix SNI callback callable race (GH-150018) 2026-05-19 20:36:46 +02:00
Victor Stinner
29415c071f
gh-149473: Emit audit event on calling os.environ.clear() (#149768)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-05-19 18:38:12 +02:00
Jelle Zijlstra
08218030a5
gh-148829: Make sentinels' repr and module customizable (#149654)
Implementation of python/peps#4968; still needs SC approval.
2026-05-19 09:18:56 -07:00
Saul Cooperman
57a0e570d3
gh-146452: Improve locking granularity in pickle's batch_dict_exact and fix race condition (#150025)
Remove assertion that could fail in rare race condition.

Replace the coarse critical section wrapping the entire function with
fine-grained sections covering only PyDict_Next + Py_INCREF.
Also handle PyDict_Next returning 0 in the single-item fast path.
2026-05-18 16:26:08 -07:00
Armaan Vakharia
56737483c2
gh-149590: Remove faulthandler_traverse (#150023)
`faulthandler_traverse` visits Python objects owned by `_PyRuntime`, not
by the module instance. With multi-phase init allowing multiple module
instances, each instance's GC traversal decrements `gc_refs` on the same
runtime-owned objects, driving it negative when two instances are
collected simultaneously.
2026-05-18 16:00:59 -07:00
sobolevn
14af19e6c0
gh-149816: Fix a RC in _random.Random.__init__ method (#149824) 2026-05-18 18:39:54 +03:00
Maurycy Pawłowski-Wieroński
a2932e9c95
gh-149464: Add os.pidfd_getfd(pidfd, targetfd, flags=0) function (#149465)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-05-18 16:29:58 +02:00
Nezuko Agent
0ed497a350
gh-149953: Fix null pointer dereference order in code_objects.c (#149956)
Move  check before
2026-05-18 11:28:28 +03:00
AN Long
acefff95ea
gh-149921: Fix reference leaks in _interpchannels and _interpqueues modules (#149922) 2026-05-17 13:09:19 +03:00
Farhan Saif
e62a61177f
gh-146452: Fix pickle segfault on concurrent mutation of dict in pickle (#146470)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-05-17 14:35:27 +05:30
Victor Stinner
a7ed0c9e1d
gh-149879: Fix test_socket on Cygwin (#149913)
Disable SCM_RIGHTS, recvmsg(), sendmsg() and sethostname() on Cygwin.
2026-05-16 10:02:19 +00:00
Victor Stinner
a0551b1a12
gh-148200: Update Modules/_hacl/ for Cygwin (#149802)
This pulls an updated version of HACL* that fixes Lib_Memzero0.c on
Cygwin, via an upstream fix.
2026-05-15 14:42:30 +02:00
Victor Stinner
3ecca22567
gh-148675: Use a string for ctypes cparam tag (#149778) 2026-05-15 13:25:09 +02:00
Victor Stinner
a8ef4679cb
gh-148675: Reuse typecodes for array.array() error message (#149779)
array.array() error message now reuses array.typecodes, instead of
maintaining an hardcoded list of valid type codes.
2026-05-15 13:22:40 +02:00
Victor Stinner
5465b69255
gh-149707: Fix compiler warning in _ctypes_test on strchr() (#149791)
Change my_strchr() return type to "const char*" (add "const").

Fix the compiler warning:

Modules/_ctypes/_ctypes_test.c: In function 'my_strchr':
Modules/_ctypes/_ctypes_test.c:451:12: warning: return discards
'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  451 |     return strchr(s, c);
      |            ^~~~~~

When using C23, strchr(text, ch) return type is "const char*" if text
type is "const char*".
2026-05-15 13:04:50 +02:00
Stan Ulbrych
f1a47e79fb
gh-149698: Update bundled expat to 2.8.1 (GH-149699) 2026-05-14 01:21:03 +02:00
Carlo Bramini
b6854c5098
gh-148575: Use /dev/fd/ to read the set of file descriptors on Cygwin (#148576) 2026-05-13 20:05:27 +00:00
Petr Viktorin
fa81cd976a
gh-140550: Update xxlimited with 3.15 limited API (GH-142827) 2026-05-13 18:35:50 +02:00
scoder
94df62542c
gh-148829: Add PySentinel_CheckExact() (#149725) 2026-05-13 10:10:37 +00:00
Sergey B Kirpichev
9eb3b14668
gh-115119: Removed bundled copy of the libmpdec (GH-133964)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Zachary Ware <zach@python.org>
2026-05-12 21:34:37 +00:00
David Huggins-Daines
e667d62f11
gh-134837: Correct and improve base85 documentation for base64 and binascii modules (GH-145843) 2026-05-12 22:46:46 +03:00
Sergey Miryanov
1a79fd0ad6
GH-149501: Fix compilation warning in _YIELD_VALUE uop (#149502) 2026-05-12 22:47:35 +05:30
Alper
8a4895985f
gh-145235: Make dict watcher API thread-safe for free-threaded builds (gh-145233)
In free-threaded builds, concurrent calls to PyDict_AddWatcher, PyDict_ClearWatcher, PyDict_Watch, and PyDict_Unwatch can race on the shared callback array and the per-dict watcher tags. This change adds a mutex to serialize watcher registration and removal, atomic operations for tag updates, and atomic acquire/release synchronization for callback dispatch in _PyDict_SendEvent.
2026-05-11 11:39:55 -04:00
Sergey B Kirpichev
c6fd7de64a
gh-149083: use sentinel to fix _functools.reduce() signature (#149591) 2026-05-10 15:22:16 -07:00
Stan Ulbrych
24b8f12544
gh-149018: Use XML_SetHashSalt16Bytes in pyexpat/_elementtree when possible (#149023) 2026-05-10 18:36:26 +01:00
ByteFlow
bc1be4f617
gh-148441: Avoid integer overflow in Expat's CharacterDataHandler (#148904)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-05-10 15:42:04 +02:00
Maurycy Pawłowski-Wieroński
354ef336e4
gh-149474: use Py_fopen in Binary{Reader,Writer} for audit hook and path-like support (#149524) 2026-05-09 01:01:35 +01:00
Neko Asakura
d2d24e46d3
gh-100239: expose sq_repeat helpers for BINARY_OP_EXTEND (#148791) 2026-05-08 11:12:20 +00:00
Maurycy Pawłowski-Wieroński
d36e5b8644
gh-149521: Do not update last_profiled_frame if it's not changed (#149522) 2026-05-08 08:25:49 +00:00
Petr Viktorin
612140e7dd
gh-149202: Fix frame pointer unwinding on ppc64le and armv7/clang (#149409)
- ppc64's backchain format is also different from x86
- On 32-bit ARM, clang needs `-mno-thumb`, not `-marm` like GCC
2026-05-07 10:37:00 +02:00