Commit graph

15867 commits

Author SHA1 Message Date
Serhiy Storchaka
1c7011d8fe
gh-150560: Fix crash in XML parser on invalid XML with multi-byte encoding (GH-150568) 2026-05-30 00:23:32 +03:00
Chien Wong
cf2cd0be82
gh-115988: Add ARM64 and RISCV BCJ filters constants in lzma module (GH-115989)
---------

Signed-off-by: Chien Wong <m@xv97.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2026-05-28 08:05:03 -07:00
Neko Asakura
39bd44fc70
gh-148871: make LOAD_COMMON_CONSTANT use immortal stackref borrows (GH-149625) 2026-05-28 12:27:37 +01:00
Serhiy Storchaka
7de4fcd445
gh-149571: Fix the C implementation of Element.itertext() (GH-149929)
It no longer emits text for comments and processing instructions.
2026-05-27 13:23:28 +03:00
Serhiy Storchaka
8ab7b43a14
gh-62259: Add support of multi-byte encodings in the XML parser (GH-149860)
Supported encodings: "cp932", "cp949", "cp950", "Big5","EUC-JP",
"GB2312", "GBK", "johab", and "Shift_JIS".

Partially supported encodings (only BMP characters): "Big5-HKSCS",
"EUC_JIS-2004", "EUC_JISX0213", "Shift_JIS-2004", "Shift_JISX0213",
"utf-8-sig" and non-standard aliases like "UTF8" (without hyphen).

The parser now raises ValueError for known unsupported
multi-byte encodings such us "ISO-2022-JP" or "raw-unicode-escape"
instead of failing later, when encounter non-ASCII data.
2026-05-26 19:40:25 +00:00
AN Long
ec23ec6870
gh-149931: Fix memory leaks on failed realloc (#149932) 2026-05-26 01:37:14 +01:00
Pablo Galindo Salgado
a5be25d3bd
gh-149619: Harden _remote_debugging error paths (#150349) 2026-05-25 23:22:46 +01:00
Donghee Na
c714b56798
gh-150114: Log the memory usage in regrtest on macOS (gh-150396) 2026-05-26 00:03:06 +09:00
Victor Stinner
dfe7ef6292
gh-150114: Log the memory usage in regrtest on FreeBSD (#150280)
Add _testcapi.get_process_memory_usage().
On FreeBSD, _testcapi is now linked to libkvm.
2026-05-25 13:45:55 +00:00
Pieter Eendebak
43c60ec2fd
gh-149449: Fix use-after-free in _PyUnicode_GetNameCAPI (#150323)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-05-24 16:17:38 +00:00
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