Commit graph

56326 commits

Author SHA1 Message Date
Bénédikt Tran
ce6bae92da
gh-143377: fix crashes in _interpreters.capture_exception (#143418) 2026-01-10 12:37:54 +01:00
Nadeshiko Manju
e2f0160026
gh-143604: Hold strong reference to executor during JIT tracing (GH-143646)
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2026-01-10 11:15:48 +00:00
Jeong, YunWon
e7f5ffa0de
gh-143641: Make ready_to_import always remove tempdir from sys.path (#143642)
Make ready_to_import always remove tempdir from sys.path
2026-01-10 12:51:42 +03:00
Heikki Toivonen
78e868fa28
gh-143586: Add Counter comparison tests to enforce missing element semantics (gh-143587) 2026-01-10 00:17:57 -06:00
Ken Jin
95259116ec
gh-142764: Restore REPLACE_OPCODE_IF_EVALUATES_PURE optimization for some ops (GH-143335) 2026-01-09 23:18:22 +00:00
Semyon Moroz
499d3a8d50
gh-136438: Make sure test_interpreters pass with all optimization levels (GH-136499) 2026-01-09 18:06:54 +01:00
Serhiy Storchaka
66bca383bd
gh-143006: Fix and optimize mixed comparison of float and int (GH-143084)
When comparing negative non-integer float and int with the same number
of bits in the integer part, __neg__() in the int subclass returning
not an int caused an assertion error.

Now the integer is no longer negated. Also, reduced the number of
temporary created Python objects.
2026-01-09 19:06:45 +02:00
Jan André Reuter
61e036691c
gh-143460: Skip infinite recusion tests for infinite stack size (#143606)
Avoid tests being killed due to OOM on Linux if a system is configured with
'ulimit -s unlimited' by skipping tests relying on infinite recursion.

While unclear if Python should support 'ulimit -s unlimited', we should at
least try to avoid failing a PGO build running tests due to an unlimited
stack size being set.

Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
2026-01-09 16:11:37 +00:00
Victor Stinner
ba10100c39
gh-143191: Use _PyOS_MIN_STACK_SIZE in _thread.stack_size() (#143601)
The stack size must be at least _PyOS_MIN_STACK_SIZE+SYSTEM_PAGE_SIZE
bytes.
2026-01-09 16:08:40 +01:00
A.Ibrahim
a4086d7f89
gh-142829: Fix use-after-free in Context.__eq__ via re-entrant ContextVar.set (#142905) 2026-01-09 17:57:34 +05:30
Victor Stinner
39a2bcf949
gh-143547: Fix PyErr_FormatUnraisable() fallback (#143557)
Hold a strong reference to 'hook' while calling the default
unraisable took to log hook failure.

Fix test_sys.UnraisableHookTest: use the right decorator function to
disable colors. Previously, tests were always skipped.
2026-01-09 13:16:22 +01:00
zhong
6d54b6ac7d
gh-143378: Fix use-after-free when BytesIO is concurrently mutated during write operations (GH-143408)
PyObject_GetBuffer() can execute user code (e.g. via __buffer__), which may
close or otherwise mutate a BytesIO object while write() or writelines()
is in progress. This could invalidate the internal buffer and lead to a
use-after-free.

Ensure that PyObject_GetBuffer() is called before validation checks.
2026-01-09 13:50:56 +02:00
Henry Chen
dcdb23f9db
gh-143429: Use compile-time NaN encoding detection for test_struct (#143432) 2026-01-09 10:46:48 +00:00
Yongtao Huang
fd6d41b292
Test: remove unintended unittest.main() in live collector tests (#143590) 2026-01-09 08:49:54 +00:00
Savannah Ostrowski
68a01f901f
GH-43374: Fix urlretrieve reporthook to report actual bytes read (#142653) 2026-01-09 00:32:05 +00:00
Brett Cannon
dfeefbe8ea
GH-139686: Revert "gh-139686: Make reloading a lazy module no-op (GH-139857)" (#143584)
This reverts commits 57db12514a and 0a97941245.
2026-01-08 22:08:03 +00:00
Russell Keith-Magee
b54a1d272e
Add Emscripten test skips for recently added tests. (#143551)
Some recent changes introduced tests that can't run on Emscripten.
This change adds test skips for those tests.
2026-01-09 05:47:38 +08:00
Heikki Toivonen
cea2d2475d
gh-143445: Optimize deepcopy for 1.04x speedup (#143449)
Gains according to pyperformance:

```
deepcopy:
Mean +- std dev: 411 us +- 2 us -> 396 us +- 3 us: 1.04x faster
Significant (t=28.94)

deepcopy_reduce:
Mean +- std dev: 4.38 us +- 0.05 us -> 4.23 us +- 0.04 us: 1.04x faster
Significant (t=20.05)
```

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-01-08 16:28:02 +01:00
Victor Stinner
efaa56f73c
gh-143528: Fix test_time.test_thread_time() (#143558)
Tolerate 100 ms instead of 20 ms to support slow CIs.
2026-01-08 14:05:57 +01:00
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
T. Wouters
b2827de18f
gh-141536: Fix a crash when running test_capi *after* test_code in the same process (#141537) 2026-01-07 16:40:33 +01: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
Serhiy Storchaka
b866a1c73f
gh-75572: Fix test_xpickle and disable it by default (GH-143503) 2026-01-06 23:51:12 +00: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
reiden
54f1ed0299
gh-134584: Eliminate redundant refcounting in TO_BOOL_ALWAYS_TRUE (GH-143427)
Co-authored-by: Ken Jin <kenjin@python.org>
2026-01-06 16:11:56 +00:00
Łukasz Langa
7dae1077cd
gh-143394: On macOS, run main PyREPL tests as "Apple Terminal" as well (GH-143461) 2026-01-06 11:10:18 +01: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
Chris Eibl
04ace41fe2
gh-143394: filter for turning off automatic margins in test_no_newline (GH-143433) 2026-01-05 22:46:08 +01:00
Łukasz Langa
4f9a8d075e
gh-69605: In test_pyrepl.test_already_imported*, invalidate FS import caches (#143436)
This makes the test robust against file systems with low timestamp resolution, which otherwise would fail to re-import in the tight loop of the test.
2026-01-05 18:00:48 +01:00
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
Bénédikt Tran
c99f766743
gh-143309: fix test_execve_env_concurrent_mutation_with_fspath_posix buildbot failure (#143415) 2026-01-04 21:44:47 +01: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
László Kiss Kollár
ef3b8829e4
gh-142927: Clarify pstats file output in docs and CLI (#143388)
When running the `profiling.sampling` module in pstats mode, the output
can be emitted in two different ways: text to stdout or a binary file
when the `--output` argument is set.

The current documentation and help text is confusing as it does not
distinguish between these two output formats so it may be surprising to
the user to get different formats depending whether `--output` is set or not.
2026-01-03 21:16:29 +00:00
Jeong, YunWon
3c56f9e2cc
gh-143001: Add @cpython_only to test_threading.ThreadTests.test_PyThreadState_SetAsyncExc (gh-143002) 2026-01-04 00:01:49 +09: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
Ken Jin
f7a03bb944
gh-134584: JIT: Remove redundant refcount from STORE_FAST (GH-143336) 2026-01-02 18:22:21 +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