Commit graph

130901 commits

Author SHA1 Message Date
Neko Asakura
b5ccf00bd6
gh-148211: refactor bool to explicit uops in JIT (GH-148258) 2026-04-09 13:20:31 +08:00
Pablo Galindo Salgado
efde4333bf
gh-148225: Validate profiling.sampling replay input (#148243) 2026-04-08 23:34:46 +00:00
Pablo Galindo Salgado
09968dd2a9
gh-148105: _pyrepl: switch console refresh to structured rendered screens (#146584) 2026-04-08 23:42:26 +01:00
nmartensen
442f83a5ea
gh-70039: smtplib: store the server name in ._host in .connect() (#115259)
Original patch by gigaplastik, extended with a few more tests.

Addresses gh-70039 and bpo-25852: failure of starttls if connect is called explicitly.
2026-04-08 17:46:25 -04:00
Michiel W. Beijen
eab7dbda3b
gh-148257: move wave whatsnew to correct section (#148262) 2026-04-08 20:53:33 +03:00
Raymond Hettinger
096212d3c0
Minor edit: Four space indent in example (#148264) 2026-04-08 12:48:54 -05:00
Diego Russo
e11315d63b
GH-115802: Remove no-plt for Linux AArch64 (#148238) 2026-04-08 16:34:04 +01:00
Kumar Aditya
6e081614eb
gh-148210: fix incorrect _BINARY_OP_SUBSCR_DICT JIT optimization (GH-148213) 2026-04-08 23:23:20 +08:00
Sacul
bb03c8bd02
gh-145866: Convert _CALL_METHOD_DESCRIPTOR_NOARGS to leave its inputs on the stack to be cleaned up by _POP_TOP (GH-148227) 2026-04-08 23:21:37 +08:00
Neko Asakura
d2fa4b2b13
gh-148211: decompose _POP_TOP_LOAD_CONST_INLINE(_BORROW) in JIT (GH-148230) 2026-04-08 23:20:31 +08:00
Shrey Naithani
461125aaa3
gh-37883: Safely skip test_resource file size tests when limits are strict (GH-145579) 2026-04-08 16:06:05 +02:00
Hugo van Kemenade
8687b9d731
gh-146609: Add colour to timeit CLI output (#146610)
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-04-08 16:18:53 +03:00
Hugo van Kemenade
2c8f26cf5c
gh-146292: Add colour to http.server logs (GH-146293)
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2026-04-08 14:10:05 +02:00
Neko Asakura
756358524e
gh-148235: remove duplicate uops _LOAD_CONST_UNDER_INLINE(_BORROW) in JIT (GH-148236) 2026-04-08 16:22:59 +08:00
Petr Viktorin
8923ca418c
gh-145921: Add "_DuringGC" functions for tp_traverse (GH-145925)
There are newly documented restrictions on tp_traverse:

    The traversal function must not have any side effects.
    It must not modify the reference counts of any Python
    objects nor create or destroy any Python objects.

* Add several functions that are guaranteed side-effect-free,
  with a _DuringGC suffix.
* Use these in ctypes
* Consolidate tp_traverse docs in gcsupport.rst, moving unique
  content from typeobj.rst there

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-04-08 09:15:11 +02:00
Gabriel Volles Marinho
0b20bff386
gh-146458: Fix REPL height and width tracking on resize (#146459)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-04-07 23:09:11 +02:00
Ramin Farajpour Cami
957b2cca8e
gh-145846: Fix memory leak in _lsprof clearEntries() context chain (#145847)
clearEntries() only freed the top currentProfilerContext but did not
walk the previous linked list. When clear() is called during active
profiling with nested calls, all contexts except the top one were
leaked. Fix by iterating the entire linked list, matching the existing
freelistProfilerContext cleanup pattern.

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-04-07 22:56:19 +02:00
Kumar Aditya
03d712e9ba
gh-142518: add thread safety annotations for tuple C-API (#148012) 2026-04-08 01:55:44 +05:30
Hugo van Kemenade
d518f15ea4 Merge branch 'main' of https://github.com/python/cpython 2026-04-07 20:34:01 +03:00
Hugo van Kemenade
8166492c29 Post 3.15.0a8 2026-04-07 20:32:33 +03:00
Kumar Aditya
e371ce10cd
gh-95004: specialize access to enums and fix scaling on free-threading (#148184)
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2026-04-07 21:43:50 +05:30
Joshua Swanson
7e0a0be409
gh-146333: Fix quadratic regex backtracking in configparser option parsing (GH-146399)
Use negative lookahead in option regex to prevent backtracking, and to avoid changing logic outside the regexes (since people could use the regex directly).
2026-04-07 16:10:34 +02:00
Victor Stinner
feee573f36
gh-148014: Accept a function name in -X presite option (#148015) 2026-04-07 14:05:39 +00:00
Jonathan Dung
e65987d4c0
gh-146547: Use lazy imports in ctypes (GH-146548) 2026-04-07 15:26:53 +02:00
grayjk
dfeb160bc3
gh-130273: Fix traceback color output with unicode characters (GH-142529)
Account for the display width of Unicode characters so that colors and underlining in traceback output is correct.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-04-07 15:05:23 +02:00
Hugo van Kemenade
55ea59e7dc Python 3.15.0a8 2026-04-07 14:24:03 +03:00
Petr Viktorin
cf59bf7647
gh-146121: Clarify security model of pkgutil.getdata; revert checks (GH-148197)
This reverts commit bcdf231946,
and clarifies get_data's security model.


Co-authored-by: Stan Ulbrych <stan@python.org>
2026-04-07 11:39:50 +02:00
Chris Eibl
a4d9d6483f
GH-145762: Fix test_ci_fuzz_stdlib for source archive builds (#145778)
Co-authored-by: Stan Ulbrych <stan@ulbrych.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-04-07 12:02:15 +03:00
Stan Ulbrych
63d3c490d4
gh-101178: Fix UB in binascii.b2a_ascii85 (#148166) 2026-04-07 08:44:03 +01:00
Petr Viktorin
fbc1a5b076
gh-146636: abi3t: Define Py_GIL_DISABLED but do not use it (GH-148142)
When compiling for abi3t, define Py_GIL_DISABLED, so that users who
check it to enable additional locking aren't broken.

But also avoid using Py_GIL_DISABLED in Python headers themselves
-- abi3 and abi3t ought to be the same except
the _Py_OPAQUE_PYOBJECT differences.

A check for this is coming in a later PR.
It will require rewriting some preprocessor conditions, some of these
changes are included in this PR.
For _Py_IsOwnedByCurrentThread & supporting functions
I opted to move them to a cpython/ header, as they're rather self-contained.
2026-04-07 09:06:17 +02:00
Gregory P. Smith
5e9d90b615
gh-144503: Pass sys.argv to forkserver as real argv elements (GH-148194)
Avoid embedding the parent's sys.argv into the forkserver -c command
string via repr().  When sys.argv is large (e.g. thousands of file
paths from a pre-commit hook), the resulting single argument could
exceed the OS per-argument length limit (MAX_ARG_STRLEN on Linux,
typically 128 KiB), causing posix_spawn to fail and the parent to
observe a BrokenPipeError.

Instead, append the argv entries as separate command-line arguments
after -c; the forkserver child reads them back as sys.argv[1:].  This
cannot exceed any limit the parent itself did not already satisfy.

Regression introduced by gh-143706 / 298d5440eb.
2026-04-06 22:41:02 -07:00
Brandt Bucher
6bb7b33e8f
GH-146128: Remove the buggy AArch64 "33rx" relocation (#146263) 2026-04-07 07:52:59 +03:00
Semyon Moroz
132abfd135
gh-112632: Add optional keyword-only argument expand to pprint (#136964)
Co-authored-by: stodoran <stefan.todoran@uipath.com>
Co-authored-by: StefanTodoran <stefan.alex4@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-04-07 07:42:54 +03:00
Tim Peters
3df0c4da4c
Note out-of-date obmalloc comments (#148149)
Vladimir's original overviews, from 1998, are still good, but going
on 30 years later details have changed. Note that, but rather try
to keep up with moving targets in a different file, point to
sys._debugmallocstats() as the sure way to discover precise current
details.

No code changes, just added a block comment.

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2026-04-06 23:08:47 -05:00
Mazin Sharaf
8a73478fed
gh-145844: Update WASI SDK from 30 to 32 (#145859)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Brett Cannon <brett@python.org>
2026-04-06 16:48:38 -07:00
Gregory P. Smith
bac4fee745
gh-73613: clarify padding= docs in for base64 & binascii modules (GH-148183)
Based on mayeut's comment in https://github.com/python/cpython/pull/147974#discussion_r3038498019.
2026-04-06 16:45:13 -07:00
Pablo Galindo Salgado
ca960b6f38
gh-148110: Resolve lazy import filter names for relative imports (#148111) 2026-04-06 22:29:02 +01:00
Fionn
a0c57a8d17
gh-137586: Open external osascript program with absolute path (GH-137584)
Open web browser with absolute path

On macOS, web browsers are opened via popen calling osascript. However,
if a user has a colliding osascript executable earlier in their PATH,
this may fail or cause unwanted behaviour.

Depending on one's environment or level of paranoia, this may be considered a security vulnerability.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-04-06 09:42:10 -07:00
Junya Fukuda
3d724dd914
gh-148072: Cache pickle.dumps/loads per interpreter in XIData (GH-148125)
Store references to pickle.dumps and pickle.loads in _PyXI_state_t
so they are looked up only once per interpreter lifetime, avoiding
repeated PyImport_ImportModuleAttrString calls on every cross-interpreter
data transfer via pickle fallback.

Benchmarks show 1.7x-3.3x speedup for InterpreterPoolExecutor
when transferring mutable types (list, dict) through XIData.
2026-04-06 11:37:02 -04:00
Pablo Galindo Salgado
f8293faf37
gh-130472: Remove readline-only hacks from PyREPL completions (#148161)
PyREPL was still carrying over two readline-specific tricks from the
fancy completer: a synthetic CSI prefix to influence sorting and a fake
blank completion entry to suppress readline's prefix insertion. Those
workarounds are not appropriate in PyREPL because the reader already
owns completion ordering and menu rendering, so the fake entries leaked
into the UI as real terminal attributes and empty menu cells.

Sort completion candidates in ReadlineAlikeReader by their visible text
with stripcolor(), and let the fancy completer return only real matches.
That keeps colored completions stable without emitting bogus escape
sequences, removes the empty completion slot, and adds regression tests
for both the low-level completer output and the reader integration.
2026-04-06 14:57:25 +00:00
Hugo van Kemenade
36f15ba5cd
gh-140279: Stale workflow needs 'actions: write' to update its own cache (#148165) 2026-04-06 13:07:15 +00:00
Pieter Eendebak
efda60e2ec
gh-100239: Propagate type info through _BINARY_OP_EXTEND in tier 2 (GH-148146) 2026-04-06 20:52:42 +08:00
Stan Ulbrych
476fadc9ae
Add Stan to docs config reviewers (#148164) 2026-04-06 15:47:44 +03:00
Wulian233
69f51625e6
gh-148119: Refactor get_type_attr_as_size to improve error handling in structseq.c (#148120) 2026-04-06 17:41:30 +05:30
Stan Ulbrych
1795fccfbc
gh-148157: Check for _PyPegen_add_type_comment_to_arg fail in _PyPegen_name_default_pair (#148158) 2026-04-06 12:56:36 +01:00
Hugo van Kemenade
acf5229081
Docs: Update "Installing Python modules" (#146249) 2026-04-06 14:21:59 +03:00
Serhiy Storchaka
d0e204fb1d
gh-148153: Do not use assert for parameter validation in base64 (GH-148154)
base64.b32encode() now always raises ValueError instead of
AssertionError for the value of map01 with invalid length.
2026-04-06 13:47:27 +03:00
Malcolm Smith
a95ee3a21d
gh-144418: Increase Android testbed emulator RAM to 4 GB (#148054)
Pre-create the Android emulator image so that the the configuration can be
modified to use 4GB of RAM.
2026-04-06 13:48:00 +08:00
Pablo Galindo Salgado
fbfc6ccb0a
gh-148144: Initialize visited on copied interpreter frames (#148143)
_PyFrame_Copy() copied interpreter frames into generator and
frame-object storage without initializing the visited byte. Incremental
GC later reads frame->visited in mark_stacks() on non-start passes, so
copied frames could expose an uninitialized value once they became live
on a thread stack again.

Reset visited when copying a frame so copied frames start with defined
GC bookkeeping state. Preserve lltrace in Py_DEBUG builds.
2026-04-06 00:23:07 +01:00
Stan Ulbrych
bce96a1813
gh-145098: Use macos-15-intel instead of unstable macos-26-intel in {jit,tail-call}.yml (#148126)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-04-05 22:23:43 +03:00