127384 Commits

Author SHA1 Message Date
Tomas R.
46151648ca
GH-131798: Optimize away type(x) in the JIT when the result is known (GH-135194) 2025-06-06 16:44:43 -07:00
Yuki Kobayashi
f00512db20
Docs: Update PyExc_* tables in the c-api documentation (GH-131640)
Add `PyExc_BaseExceptionGroup` and `PyExc_EncodingWarning`
2025-06-06 17:51:47 +02:00
Tan Long
62b3d2d443
gh-133390: Support SQL keyword completion for sqlite3 CLI (#133393) 2025-06-06 16:52:41 +02:00
Petr Viktorin
b22b964a5c
gh-57089: Note _layout_ in the bitfield docs (GH-134148)
Co-authored-by: Meador Inge <meadori@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-06-06 16:51:40 +02:00
Petr Viktorin
1adca08d65
gh-134160: Use PyModuleDef.m_free in the example module xxlimited (GH-135174)
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2025-06-06 14:08:58 +00:00
Petr Viktorin
e413e26719
gh-134891: Add PyUnstable_Unicode_GET_CACHED_HASH (GH-134892) 2025-06-06 15:51:00 +02:00
Jean-Louis GUENEGO
343182853f
feat(docs): type fix - apply pep8 by using docstring instead of comment in the doc. (#135181)
Giving the right example incitates the tutorial readers to do the same in the future.
2025-06-06 15:16:12 +02:00
Rafael Fontenelle
39859fcac5
Fix versionadded directive rendering in c-api/arg.rst (#135199) 2025-06-06 14:23:07 +02:00
Victor Stinner
82415acf62
gh-134036: Update test_syntax for gh-133999 (#135204) 2025-06-06 12:22:14 +00:00
Victor Stinner
e004cf8fd5
gh-134993: Add os.lstat() to os.supports_dir_fd (#135188) 2025-06-06 14:11:49 +02:00
Serhiy Storchaka
6ef06fad84
gh-135120: Add test.support.subTests() (GH-135121) 2025-06-06 13:52:48 +02:00
sobolevn
0d9ccc87a2
gh-134036: Improve error messages for invalid raise statements (#134077) 2025-06-06 01:51:06 +01:00
Weipeng Hong
a7d41e8aab
gh-135155: Added dependencies required for compiling the _zstd module (GH-135156) 2025-06-06 00:44:25 +00:00
Mark Shannon
b90ecea9e6
GH-132554: Fix tier2 FOR_ITER implementation and optimizations (GH-135137) 2025-06-05 18:53:57 +01:00
Sergey Miryanov
d9cad074d5
gh-134155: fix AttributeError in email._header_value_parser.get_address (#134194)
Append the defect to defects instead of to the parse tree.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-05 13:28:11 -04:00
Weipeng Hong
1b55e12766
gh-135166: Fix exception type expected by test.test_zstd (GH-135167) 2025-06-05 17:00:07 +01:00
rialbat
8919cb4ad9
gh-135161: Remove redundant NULL check for 'exc' after dereference in ceval.c (#135162) 2025-06-05 17:08:48 +02:00
Victor Stinner
9258f3da91
gh-134989: Fix Py_RETURN_NONE in the limited C API (GH-135165)
Fix Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE macros in the
limited C API 3.11 and older:
Don't treat Py_None, Py_True and Py_False as immortal.
2025-06-05 14:43:47 +02:00
Emma Smith
4b44b3409a
gh-134938: Add set_pledged_input_size() to ZstdCompressor (GH-135010) 2025-06-05 14:31:49 +03:00
Victor Stinner
3d396ab759
gh-135124: Change stdout errors in regrtest worker process (#135138)
Set sys.stdout encoder error handler to backslashreplace in regrtest
workers to avoid UnicodeEncodeError when printing a traceback
or any other non-encodable character.

Move the code from the Regrtest class to setup_process().

Call setup_process() earlier, before displaying regrtest headers.
2025-06-05 11:17:03 +02:00
Malcolm Smith
2e1544fd2b
gh-131531: android.py enhancements to support cibuildwheel (#132870)
Modifies the environment handling and execution arguments of the Android management
script to support the compilation of third-party binaries, and the use of the testbed to 
invoke third-party test code.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-06-05 13:46:16 +08:00
mpage
6b77af257c
gh-134889: Fix handling of a few opcodes when optimizing LOAD_FAST (#134958)
We were incorrectly handling a few opcodes that leave their operands on the stack. Treat all of these conservatively; assume that they always leave operands on the stack.
2025-06-04 16:07:58 -07:00
T. Wouters
e598eecf4c
gh-135144: Add _remote_debugging to the MSI (legacy) Windows installers. (#135145)
Add _remote_debugging to the MSI (legacy) installers.
2025-06-04 21:39:00 +02:00
Brett Cannon
a10b321a58
Update the devcontainer image to the latest version (GH-135143)
Fixes an issue where the WASI tools were being incorrectly installed under the ARM image.
2025-06-04 17:06:10 +00:00
Terry Jan Reedy
0df15d0d4d
gh-129876: Update IDLE News3.txt to May 2025 (#135139) 2025-06-04 11:26:19 -04:00
Victor Stinner
c21113072c
gh-134989: Implement PyObject_DelAttr() as a macro in the limited C API (GH-135021) 2025-06-04 15:07:52 +02:00
Thomas Grainger
40c8be0008
gh-126483: disable warnings filters mutation in concurrent test (GH-132694)
The `test_ssl_in_multiple_threads` test failed because `test_check_hostname_idn()`
modified the global warnings filters via `warnings_helper.check_no_resource_warning()`.
Only check for warnings when the context aware warnings feature is enabled, which makes
the warnings filter context-local and thread-safe.
2025-06-04 09:00:25 -04:00
Daniel Hollas
bc00ce941e
gh-135074: Fix exception messages in test.support module (GH-135076) 2025-06-04 14:58:34 +02:00
Furkan Onder
5b3865418c
gh-135108: Fix utmp.h inclusion in posixmodule.c on NetBSD (GH-135109) 2025-06-04 08:51:18 -04:00
Pablo Galindo Salgado
1f51510444
Use a more clear example for the PEP 758 what's new section (#135118) 2025-06-04 09:23:08 +00:00
Sam Gross
cc581f32bf
gh-135099: Only wait on _PyOS_SigintEvent() in main thread (GH-135100)
On Windows, the `_PyOS_SigintEvent()` event handle is used to interrupt
the main thread when Ctrl-C is pressed. Previously, we also waited on
the event from other threads, but ignored the result. However, this can
race with interpreter shutdown because the main thread closes the handle
in `_PySignal_Fini` and threads may still be running and using mutexes
during interpreter shtudown.

Only use `_PyOS_SigintEvent()` in the main thread in parking_lot.c, like
we do in other places in the CPython codebase.
2025-06-04 09:35:56 +02:00
Christian Veenhuis
8f778f7bb9
gh-135103: Remove an unused local variable in Lib/code.py (GH-135104)
remove unused local variable
2025-06-04 13:57:31 +09:00
Joe Rickerby
dba9de731b
gh-135101: When choosing the default simulator device, don't use simctl --set testing (#135102)
On a fresh Xcode install (including some CI provider configurations), there is
no pre-existing testing set that can be used to identify simulator models. Use
the default device set to detect available models instead. Live testing 
simulators are still created in the testing set.
2025-06-04 08:31:43 +08:00
Duane Griffin
1ffe913c20
gh-127081: use getlogin_r if available (gh-132751)
The `getlogin` function is not thread-safe: replace with `getlogin_r` where
available.
2025-06-03 13:28:58 -04:00
tpburns
54ca55978e
gh-134248 test_getallocatedblocks pre-check to ignore immortalized strings (#134871)
When sanity checking against gettotalrefcount(), we exclude the blocks for
immortalized strings since their references are not tracked/reported. This
now matches refleak.py's book-keeping using the same functions.
2025-06-03 18:00:25 +02:00
Łukasz Langa
3612d8f517
gh-135034: Normalize link targets in tarfile, add os.path.realpath(strict='allow_missing') (#135037)
Addresses CVEs 2024-12718, 2025-4138, 2025-4330, and 2025-4517.

Signed-off-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-03 12:42:11 +02:00
Roei Ben Artzi
ec12559eba
gh-131884: Fix incorrect formatting in json.dumps() when using indent and skipkeys=True (GH-132200) 2025-06-03 10:40:25 +03:00
stratakis
485b499610
gh-128605: Add branch protections for x86_64 in asm_trampoline.S (#128606)
Apply Intel Control-flow Technology for x86-64 on asm_trampoline.S.

Required for mitigation against return-oriented programming (ROP)
and Call or Jump Oriented Programming (COP/JOP) attacks.

Manual application is required for the assembly files.

See also: https://sourceware.org/annobin/annobin.html/Test-cf-protection.html
2025-06-03 09:09:43 +02:00
Victor Stinner
6e80f11eb5
gh-135028: Increase parser MAXSTACK for nested parenthesis (#135031) 2025-06-03 08:40:45 +02:00
Donghee Na
b525e31b7f
gh-134875: Fix mimallc build error for the old compilers (gh-134994) 2025-06-03 08:40:40 +09:00
Stan Ulbrych
0ac9e17fb4
gh-134830: Fix reference in Doc/extending/windows.rst (GH-134831)
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2025-06-03 00:08:20 +02:00
Serhiy Storchaka
df98a47a61
gh-132813: Improve error messages for incorrect types and values of csv.Dialog attributes (GH-133241)
Make them similar to PyArg_Parse error messages, mention None as
a possible value, show a wrong type and the string length.
2025-06-02 23:35:41 +03:00
Serhiy Storchaka
e814f43f2c
gh-74232: Add a note about roundtrip of non-float numerics in CSV (GH-134963) 2025-06-02 23:31:06 +03:00
Serhiy Storchaka
7a79f52d83
gh-133454: Mark test_queue tests with many threads as bigmem (gh-134575)
50 producer and 50 consumer threads need more than 5GB of memory.
2025-06-02 23:25:32 +03:00
Rafael Fontenelle
c7051a3669
Remove newline in Doc/c-api/lifecycle.rst for gettext builder (GH-135013) 2025-06-02 21:13:08 +03:00
Serhiy Storchaka
0cec424af5
gh-66234: Add flag to disable the use of mmap in dbm.gnu (GH-135005)
This may harm performance, but improve crash tolerance.
2025-06-02 21:08:26 +03:00
Duane Griffin
44fb7c361c
gh-134908: Protect textiowrapper_iternext with critical section (gh-134910)
The `textiowrapper_iternext` function called `_textiowrapper_writeflush`, but did not
use a critical section, making it racy in free-threaded builds.
2025-06-02 17:22:41 +00:00
Łukasz Langa
055827528f
gh-130999: Fix globals() poisoning in test_traceback (gh-135030) 2025-06-02 16:57:08 +02:00
Pieter Eendebak
26a1cd4e8c
gh-123471: make concurrent iteration over itertools.cycle safe under free-threading (#131212)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-06-02 20:13:32 +05:30
Duane Griffin
b6237c3602
gh-117852: fix argument checking of async_generator.athrow (#134868)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-06-02 20:04:26 +05:30