Commit graph

32026 commits

Author SHA1 Message Date
Aniket
f3e069a7ab
gh-140025: Fix queue.SimpleQueue.__sizeof__() to return correct size (#143137) 2026-01-08 12:40:25 +00:00
Serhiy Storchaka
c07e5ec0a9
gh-143553: Add support for parametrized resources in regrtests (GH-143554)
For example, "-u xpickle=2.7" will run test_xpickle only against Python 2.7.
2026-01-08 13:51:38 +02:00
Bartosz Sławecki
6c9f7b4406
gh-143517: Fix an edge case in rewriting stringified starred annotations (#143518) 2026-01-07 19:41:27 -08:00
Savannah Ostrowski
9a3263ff8f
GH-142950: Process format specifiers before colourization in argparse help (#142960) 2026-01-07 17:39:47 +00:00
Łukasz Langa
b3e4a3462f
gh-138568: Make help mode in PyREPL not exit on empty line input (#143512)
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong0618 <zouzou0208@gmail.com>
2026-01-07 16:30:58 +01:00
Petr Viktorin
8565ddd288
gh-141671: PyMODINIT_FUNC: apply __declspec(dllexport) on Windows (GH-141672) 2026-01-07 13:09:48 +01:00
Nadeshiko Manju
0a5c04a5ce
gh-134584: Eliminate redundant refcounting from TO_BOOL_STR (GH-143417)
Signed-off-by: Manjusaka <me@manjusaka.me>
2026-01-06 21:11:53 +00:00
Ken Jin
df355348f0
gh-142982: Specialize CALL_FUNCTION_EX (GH-143391) 2026-01-06 20:34:08 +00:00
Kumar Aditya
74bb3ca1f8
gh-142863: optimize list and set calls with generator expressions (#142864) 2026-01-06 23:23:28 +05:30
Ken Jin
8735daf3e8
gh-75572: Forward-port test_xpickle from Python 2 to 3 (GH-22452)
Move data classes used in tests to separate file test_picklecommon.py,
so it can be imported in old Python versions.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-06 19:03:03 +02:00
Ken Jin
90c44bc803
gh-131798: Support generator frames in the JIT optimizer (GH-143340) 2026-01-06 16:39:57 +00:00
Kumar Aditya
faa3dc7c64
gh-143469: enable LOAD_ATTR_MODULE specialization even if __getattr__ is defined (#143470) 2026-01-06 22:09:18 +05:30
Gleb Smirnoff
05406b221d
gh-142991: socketmodule: fixed getsockaddrlen() for PF_DIVERT socket (#142993) 2026-01-06 17:25:29 +01:00
Clay Dugo
d745b60ef2
gh-143474: Add os.RWF_ATOMIC constant (GH-143475) 2026-01-06 09:35:51 -05:00
Serhiy Storchaka
4d21297d28
gh-41779: Allow defining any __slots__ for a class derived from tuple (GH-141763) 2026-01-06 11:36:00 +02:00
Kumar Aditya
d6f77e6a3f
gh-116738: make entering of contextvars.Context thread safe (#143074) 2026-01-06 12:24:02 +05:30
Loïc Simon
bfac54d861
gh-69605: Check for already imported modules in PyREPL module completion (GH-139461)
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2026-01-05 16:18:54 +01:00
Denizhan Dakılır
68fcb958eb
gh-143082: Make readline work when sys.stdin is explicitly passed to pdb (#143083) 2026-01-04 20:39:11 -08:00
Chris Eibl
e6bfe4d886
gh-139757: Add BINARY_OP_SUBSCR_USTR_INT (GH-143389) 2026-01-04 14:14:27 +00:00
Bénédikt Tran
9609574e7f
gh-143309: fix UAF in os.execve when the environment is concurrently mutated (#143314) 2026-01-03 23:05:57 +01:00
Aaron Wieczorek
6c53af18f6
gh-143308: fix UAF when PickleBuffer is concurrently mutated in a callback (#143312)
Co-authored-by: Aaron Wieczorek <woz@Aarons-MacBook-Pro.local>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-01-03 23:01:59 +01:00
Donghee Na
12283f6373
gh-141504: Factor out tracing and optimization heuristics into a single object (gh-143381) 2026-01-03 15:22:14 +00:00
Pablo Galindo Salgado
27434c68f8
gh-138122: Skip threads on EPERM in blocking mode profiler (GH-143368)
When using blocking mode in the remote debugging profiler, ptrace calls
to seize threads can fail with EPERM if the thread has exited between
listing and attaching, is in a special kernel state, or is already being
traced. Previously this raised a RuntimeError that was caught by the
Python sampling loop,and retried indefinitely since EPERM is
a persistent condition that will not resolve on its own.

Treat EPERM the same as ESRCH by returning 1 (skip this thread) instead
of -1 (fatal error). This allows profiling to continue with the threads
that can be traced rather than entering an endless retry loop printing
the same error message repeatedly.
2026-01-03 15:37:16 +01:00
Olga Matoula
2c39b9d2f2
gh-136924: Suspend REPL colorizing when in a REPL interactive command (GH-136926)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2026-01-03 14:35:34 +01:00
Bartosz Sławecki
e7c542de5f
gh-140648: Make asyncio REPL respect the -I flag (isolated mode) (#143045) 2026-01-03 13:33:04 +05:30
Kumar Aditya
abdbe0b807
gh-142615: disallow multiple initializations of asyncio.Task and asyncio.Future (#142616) 2026-01-03 13:27:02 +05:30
Aaron Wieczorek
b538c2832d
gh-143361: Pass PY_VECTORCALL_ARGUMENTS_OFFSET in _Py_CallBuiltinClass_StackRefSteal (GH-143367)
Co-authored-by: Aaron Wieczorek <woz@Aarons-MacBook-Pro.local>
2026-01-02 20:43:00 +00:00
Stan Ulbrych
0417dabe3f
gh-138897: Use _pyrepl.pager for _sitebuiltins._Printer (GH-138898)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2026-01-02 16:24:48 +01:00
Chris Eibl
ef6f92a2a6
gh-139262: Prevent swallowing REPL input on Windows (GH-139263)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2026-01-02 16:17:45 +01:00
Donghee Na
61f2ad9a3a
gh-139757: Fix unintended bytecode specialization for non-ascii string (gh-143352) 2026-01-02 14:05:08 +00:00
Jan-Eric Nitschke
8a2deea1fc
gh-128067: Fix pyrepl overriding printed output without newlines (#138732)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2026-01-02 14:04:37 +01:00
Bénédikt Tran
9712dc1d9e
gh-143310: fix crash in Tcl object conversion with concurrent mutations (#143321) 2026-01-02 10:51:05 +01:00
Gregory P. Smith
61fc72a4a4
gh-124951: Optimize base64 encode & decode for an easy 2-3x speedup [no SIMD] (GH-143262)
Optimize base64 encoding/decoding by eliminating loop-carried dependencies. Key changes:
- Add `base64_encode_trio()` and `base64_decode_quad()` helper functions that process complete groups independently
- Add `base64_encode_fast()` and `base64_decode_fast()` wrappers
- Update `b2a_base64` and `a2b_base64` to use fast path for complete groups

Performance gains (encode/decode speedup vs main, PGO builds):
```
             64 bytes    64K        1M
  Zen2:      1.2x/1.8x   1.7x/2.8x  1.5x/2.8x
  Zen4:      1.2x/1.7x   1.6x/3.0x  1.5x/3.0x  [old data, likely faster]
  M4:        1.3x/1.9x   2.3x/2.8x  2.4x/2.9x  [old data, likely faster]
  RPi5-32:   1.2x/1.2x   2.4x/2.4x  2.0x/2.1x
```

Based on my exploratory work done in https://github.com/python/cpython/compare/main...gpshead:cpython:claude/vectorize-base64-c-S7Hku

See PR and issue for further thoughts on sometimes MUCH faster SIMD vectorized versions of this.
2026-01-01 22:03:05 -08:00
Pablo Galindo Salgado
e5ad7b7694
gh-138122: Integrate live profiler TUI with _colorize theming system (#142360)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-01-01 21:10:52 +00:00
Nadeshiko Manju
d00d39f58e
gh-134584: Eliminate redundant refcounting from _LOAD_ATTR_SLOT (GH-143320)
Signed-off-by: Manjusaka <me@manjusaka.me>
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2026-01-01 17:27:02 +00:00
Bénédikt Tran
422ca074bc
Amend NEWS entries for PRs GH-139553 and GH-142790 (#143329) 2026-01-01 14:16:26 +00:00
Bénédikt Tran
7f6c16a956
gh-142830: prevent some crashes when mutating sqlite3 callbacks (#143245) 2026-01-01 11:55:05 +01:00
AN Long
3c4429f65a
gh-135852: Remove out of tree pywin32 dependency for NTEventLogHandler (GH-137860)
Add RegisterEventSource(), DeregisterEventSource(), ReportEvent()
and a number of EVENTLOG_* constants to _winapi.
2025-12-31 12:50:50 +02:00
Serhiy Storchaka
aa8a43d179
gh-143237: Fix support of named pipes in the rotating logging handlers (GH-143259)
This fixes regression introduced in GH-105887.
2025-12-30 14:56:29 +00:00
dgpb
23ad9c5d01
gh-142939: difflib.get_close_matches performance (#142940) 2025-12-30 07:15:59 +00:00
Bénédikt Tran
b6b0e14b3d
gh-143200: fix UAFs in Element.__{set,get}item__ when the element is concurrently mutated (#143226) 2025-12-29 18:30:51 +01:00
Ken Jin
daa9aa4c0a
gh-143183: Rewind stop tracing to previous target (GH-143187)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-12-28 22:12:31 +00:00
Tomas R.
713684de53
gh-131798: Remove bounds check when indexing into tuples with a constant index (#137607)
* Remove bounds check when indexing into tuples with a constant index

* Add news entry

* fixup after rebase
2025-12-28 22:06:06 +01:00
Prithviraj Chaudhuri
fa9a4254e8
gh-142195: Fixed Popen.communicate indefinite loops (GH-143203)
Changed condition to evaluate if timeout is less than or equals to 0. This is needed for simulated time environments such as Shadow where the time will match exactly on the boundary.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2025-12-28 16:57:44 +00:00
Fatih Çelik
3ca1f2a370
gh-143241: Fix infinite loop in zoneinfo._common.load_data (#143243)
Correctly reject truncated TZif files in `ZoneInfo.from_file`.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-12-28 15:48:43 +01:00
Pablo Galindo Salgado
3ccc76f036
gh-143228: Fix UAF in perf trampoline during finalization (#143233) 2025-12-28 13:50:23 +00:00
Serhiy Storchaka
522563549a
gh-143003: Fix possible shared buffer overflow in bytearray.extend() (GH-143086)
When __length_hint__() returns 0 for non-empty iterator, the data can be
written past the shared 0-terminated buffer, corrupting it.
2025-12-28 12:30:36 +00:00
Bénédikt Tran
61ee04834b
gh-142557: fix UAF in bytearray.__mod__ when object is mutated while formatting %-style arguments (#143213) 2025-12-27 14:57:13 +00:00
Bénédikt Tran
00e24b80e0
gh-142664: fix UAF in memoryview.__hash__ via re-entrant data's __hash__ (#143217) 2025-12-27 13:12:03 +00:00
Bénédikt Tran
9976c2b634
gh-143195: fix UAF in {bytearray,memoryview}.hex(sep) via re-entrant sep.__len__ (#143209) 2025-12-27 13:32:52 +01:00