Commit graph

127131 commits

Author SHA1 Message Date
Hugo van Kemenade
12d3f883ae Python 3.14.0b2 2025-05-26 16:26:47 +03:00
Miss Islington (bot)
6c917cb11c
[3.14] gh-91048: Correct Apple platform includes for iOS. (GH-134712) (#134714)
Correct Apple platform includes for iOS.
(cherry picked from commit 965662ee4a)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-05-26 13:10:37 +00:00
Miss Islington (bot)
da3d55403a
[3.14] gh-132710: add missing NEWS entry for GH-134697 (GH-134705) (#134707)
gh-132710: add missing NEWS entry for GH-134697 (GH-134705)
(cherry picked from commit 9eb84d83e0)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-26 12:46:29 +02:00
Bénédikt Tran
072f50fc12
[3.14] gh-132710: only use stable _uuid.generate_time_safe() to deduce MAC address (GH-132901) (#134697)
(cherry picked from commit 3bffada467)
2025-05-26 10:45:36 +00:00
Miss Islington (bot)
c8379c7edf
[3.14] gh-134559: Add versionadded for `object.__replace__()` (GH-134672) (#134699)
gh-134559: Add versionadded for ``object.__replace__()`` (GH-134672)
(cherry picked from commit 71290a6fbe)

Co-authored-by: tmlnv <108088921+tmlnv@users.noreply.github.com>
2025-05-26 10:29:51 +00:00
Bénédikt Tran
ed52549c37
[3.14] gh-134208: remove dead AC directives for _curses.window.{chgat,getstr,instr} (GH-134325) (#134701)
(cherry picked from commit 29e8115964)
2025-05-26 10:09:02 +00:00
Miss Islington (bot)
dc441efbd0
[3.14] gh-132493: Remove __annotations__ usage in inspect._signature_is_functionlike (GH-133415) (#133796)
gh-132493: Remove __annotations__ usage in inspect._signature_is_functionlike (GH-133415)

This check is potentially problematic because it could force evaluation of
annotations unnecessarily. This doesn't trigger for builtin objects (functions,
classes, or modules) with annotations, but it could trigger for third-party objects.

The check was not particularly useful anyway, because it succeeds if ``__annotations__``
is a dict or None, so the only thing this did was guard against objects that have an
``__annotations__`` attribute that is of some other type. That doesn't seem particularly
useful, so I just removed the check.
(cherry picked from commit cb6596c6aa)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-26 08:22:14 +00:00
Miss Islington (bot)
1ce68f6297
[3.14] gh-134152: Fix UnboundLocalError in email._header_value_parser _get_ptext_to_endchars (GH-134233) (#134678)
Co-authored-by: R. David Murray <rdmurray@bitdance.com>
2025-05-26 11:02:52 +03:00
Miss Islington (bot)
ebfd18b3f0
[3.14] gh-127833: lexical analysis: Improve section on Names (GH-131474) (#134423)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
2025-05-26 11:00:17 +03:00
Miss Islington (bot)
16187b58bf
[3.14] gh-132876: workaround broken ldexp() on Windows 10 (GH-133135) (#134684)
gh-132876: workaround broken ldexp() on Windows 10 (GH-133135)

* gh-132876: workaround broken ldexp() on Windows 10

ldexp() fails to round subnormal results before Windows 11,
so hide their bug.
(cherry picked from commit cf8941c603)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Tim Peters <tim.peters@gmail.com>
2025-05-25 22:23:45 -05:00
Miss Islington (bot)
7216f7b59c
[3.14] gh-69605: Disable PyREPL module autocomplete fallback on regular completion (gh-134181) (gh-134680)
(cherry picked from commit 0e3bc962c6)

Co-authored-by: Loïc Simon <loic.simon@napta.io>
2025-05-25 23:33:02 +00:00
Pablo Galindo Salgado
1822f33b1a
[3.14] gh-91048: Refactor and optimize remote debugging module (#134652) (#134673)
gh-91048: Refactor and optimize remote debugging module (#134652)

Completely refactor Modules/_remote_debugging_module.c with improved
code organization, replacing scattered reference counting and error
handling with centralized goto error paths. This cleanup improves
maintainability and reduces code duplication throughout the module while
preserving the same external API.

Implement memory page caching optimization in Python/remote_debug.h to
avoid repeated reads of the same memory regions during debugging
operations. The cache stores previously read memory pages and reuses
them for subsequent reads, significantly reducing system calls and
improving performance.

Add code object caching mechanism with a new code_object_generation
field in the interpreter state that tracks when code object caches need
invalidation. This allows efficient reuse of parsed code object metadata
and eliminates redundant processing of the same code objects across
debugging sessions.

Optimize memory operations by replacing multiple individual structure
copies with single bulk reads for the same data structures. This reduces
the number of memory operations and system calls required to gather
debugging information from the target process.

Update Makefile.pre.in to include Python/remote_debug.h in the headers
list, ensuring that changes to the remote debugging header force proper
recompilation of dependent modules and maintain build consistency across
the codebase.

Also, make the module compatible with the free threading build as an extra :)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>

(cherry picked from commit 42b25ad4d3)
2025-05-25 22:10:20 +00:00
Miss Islington (bot)
f68f05cbe3
[3.14] gh-115999: Add PyCodeObject.co_tlbc to the debug offsets (GH-134286) (#134348)
gh-115999: Add PyCodeObject.co_tlbc to the debug offsets (GH-134286)
(cherry picked from commit dd7f113057)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-05-25 21:16:10 +00:00
Miss Islington (bot)
f5a8bfa335
[3.14] Fix sphinx-lint warnings (default-role used). (GH-134647) (#134670)
Fix sphinx-lint warnings (default-role used). (GH-134647)
(cherry picked from commit 24a47155d2)

Co-authored-by: Julien Palard <julien@palard.fr>
2025-05-25 19:29:04 +00:00
Miss Islington (bot)
6917fbf98f
[3.14] GH-130328: Fix WindowsConsoleGetEventTests after gh-133728 (gh-134660) (gh-134666)
(cherry picked from commit 1000283694)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-05-25 18:43:07 +00:00
Miss Islington (bot)
9c6d2dbe26
[3.14] gh-133960: Improve typing.evaluate_forward_ref (GH-133961) (#134663)
gh-133960: Improve typing.evaluate_forward_ref (GH-133961)

As explained in GH-133960, this removes most of the behavior differences with ForwardRef.evaluate.
The remaining difference is about recursive evaluation of forwardrefs; this is practically useful
in cases where an annotation refers to a type alias that itself is string-valued.

This also improves several edge cases that were previously not handled optimally. For example,
the function now takes advantage of the partial evaluation behavior of ForwardRef.evaluate() to
evaluate more ForwardRefs in the FORWARDREF format.

This also fixes GH-133959 as a side effect, because the buggy behavior in GH-133959 derives from
evaluate_forward_ref().
(cherry picked from commit 57fef27cfc)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-25 17:52:04 +00:00
Miss Islington (bot)
8c6653428f
[3.14] annotationlib docs: note that ForwardRef.evaluate eventually defaults to empty globals (GH-134661) (#134662)
annotationlib docs: note that ForwardRef.evaluate eventually defaults to empty globals (GH-134661)
(cherry picked from commit b51b08a0a5)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-25 10:39:44 -07:00
Miss Islington (bot)
c61fd7c0f2
[3.14] gh-134582: Fix t-strings untokenize() roundtrip removing space between braces (GH-134603) (#134659)
gh-134582: Fix t-strings untokenize() roundtrip removing space between braces (GH-134603)
(cherry picked from commit 52509cc94b)

Co-authored-by: Loïc Simon <loic.pano@gmail.com>
2025-05-25 16:48:19 +00:00
Miss Islington (bot)
cbf4ccf1d0
[3.14] gh-133684: Fix get_annotations() where PEP 563 is involved (GH-133795) (#134656)
gh-133684: Fix get_annotations() where PEP 563 is involved (GH-133795)
(cherry picked from commit 3e562b3942)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-25 16:05:19 +00:00
Miss Islington (bot)
d82d445b18
[3.14] gh-133778: Fix setting __annotations__ under PEP 563 (GH-133794) (#134655)
gh-133778: Fix setting `__annotations__` under PEP 563 (GH-133794)
(cherry picked from commit 4443110c34)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-25 16:04:22 +00:00
Miss Islington (bot)
93aee568c0
[3.14] GH-130328: Speedup pasting in legacy console on Windows (gh-133728) (#134653)
(cherry picked from commit 91b48868a8)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-05-25 15:54:28 +02:00
Miss Islington (bot)
80d70defc2
[3.14] gh-134578: Mark more slow tests (GH-134579) (GH-134590)
(cherry picked from commit 77eade39f9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-24 15:06:54 +00:00
Bénédikt Tran
81f099375e
[3.14] gh-134168: fix http.server CLI support for IPv6 and --directory when serving over HTTPS (GH-134169) (#134630)
[3.14] gh-134168: fix `http.server` CLI support for IPv6 and `--directory` when serving over HTTPS (GH-134169)
(cherry picked from commit 2fd09b0110)

Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
2025-05-24 15:34:31 +02:00
Miss Islington (bot)
162e3f3511
[3.14] gh-134595: Update HOWTO to reflect change in CIBW option (GH-134598) (#134622)
Co-authored-by: Jasper Wong <111284156+3willows@users.noreply.github.com>
2025-05-24 07:21:34 +00:00
Miss Islington (bot)
00fd5440f0
[3.14] gh-80334: fix multiprocessing.freeze_support for other spawn platforms (GH-134462) (#134619)
gh-80334: fix multiprocessing.freeze_support for other spawn platforms (GH-134462)

Doc/library/multiprocessing.rst: freeze_support: Change to specify spawn method instead of platform
Have multiprocessing.freeze_support() enable on spawn, not just win32.

---------
(cherry picked from commit 80284b5c5e)

Co-authored-by: Eddy Mulyono <eddymul@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-05-24 04:16:02 +00:00
Miss Islington (bot)
de9444ef94
[3.14] gh-134546: ensure remote pdb script is readable (GH-134552) (#134616)
gh-134546: ensure remote pdb script is readable (GH-134552)
(cherry picked from commit 74a9c60f3e)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2025-05-24 03:34:17 +00:00
Miss Islington (bot)
576177d4b3
[3.14] gh-128840: Limit the number of parts in IPv6 address parsing (GH-128841) (#134610)
gh-128840: Limit the number of parts in IPv6 address parsing (GH-128841)

GH-128840: Limit the number of parts in IPv6 address parsing
Limit length of IP address string to 39

---------
(cherry picked from commit 47f1161d3a)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-05-23 20:33:35 -07:00
Miss Islington (bot)
38a38243b7
[3.14] gh-132983: Make _zstd C code PEP 7 compliant (GH-134605) (#134609)
gh-132983: Make _zstd C code PEP 7 compliant (GH-134605)

Make _zstd C code PEP 7 compliant
(cherry picked from commit 973b8f69d3)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-05-24 02:28:40 +00:00
Miss Islington (bot)
f301af627e
[3.14] gh-132983: Slightly tweak error messages for _zstd compressor/decompressor options dict (GH-134601) (#134602)
gh-132983: Slightly tweak error messages for _zstd compressor/decompressor options dict (GH-134601)

Slightly tweak error messages for options dict
(cherry picked from commit f478331f98)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-05-23 22:18:08 +00:00
Eric Snow
7476f90af2
[3.14] gh-134557: Revert "[3.14] gh-132775: Use _PyCode GetScriptXIData()" (gh-134600)
This reverts commit bbf8048c0f, AKA gh-134515.

We are reverting due to refleaks on free-threaded builds.
2025-05-23 20:11:38 +00:00
Miss Islington (bot)
09a34f1f65
[3.14] gh-134381: Fix RuntimeError when starting not-yet started Thread after fork (gh-134514) (gh-134596)
(cherry picked from commit 9a2346df86)

Co-authored-by: Jiucheng(Oliver) <git.jiucheng@gmail.com>
2025-05-23 19:49:13 +00:00
Miss Islington (bot)
6e60586175
[3.14] gh-133454: Reduce the number of threads in test_racing_getbuf_and_releasebuf (GH-133458) (GH-134589)
The original reproducer only used 10 threads.
(cherry picked from commit fc0c9c2412)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-23 17:23:47 +00:00
Miss Islington (bot)
adb0794692
[3.14] Further improves Advanced installation docs for PyManager (GH-134541) (GH-134576)
Further improves Advanced installation docs for PyManager (GH-134541)
(cherry picked from commit 99a9ab1c64)

Co-authored-by: Steve Dower <steve.dower@python.org>
2025-05-23 10:23:06 +00:00
Miss Islington (bot)
81675941fb
[3.14] gh-133885: Use locks instead of critical sections for _zstd (gh-134289) (gh-134560)
Move from using critical sections to locks for the (de)compression methods.
Since the methods allow other threads to run, we should use a lock rather
than a critical section.
(cherry picked from commit 8dbc119719)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-05-23 10:00:38 +00:00
Miss Islington (bot)
896b745a7a
[3.14] gh-106318: Add example for str.count() (GH-134519) (#134574)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
2025-05-23 09:53:16 +00:00
Miss Islington (bot)
7efe67ae35
[3.14] gh-106318: Add example for str.center() (GH-134518) (#134571)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
2025-05-23 09:51:17 +00:00
Miss Islington (bot)
73967c4c01
[3.14] gh-134451: Converted asyncio.tools.CycleFoundException from dataclass to a regular exception type. (GH-134513) (#134564)
gh-134451: Converted `asyncio.tools.CycleFoundException` from dataclass to a regular exception type. (GH-134513)
(cherry picked from commit f9324cb3cb)

Co-authored-by: Evgeny Demchenko <v1mpire@icloud.com>
2025-05-23 05:40:56 +00:00
Miss Islington (bot)
c67eb41a3b
[3.14] gh-114177: avoid calling connection lost callbacks when loop is already closed in asyncio subprocess (GH-134508) (#134561)
gh-114177: avoid calling connection lost callbacks when loop is already closed in asyncio subprocess (GH-134508)
(cherry picked from commit 5804ee7b46)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-23 04:58:51 +00:00
Miss Islington (bot)
1cdbb33771
[3.14] gh-128307: Update docs for asyncio.create_task, TaskGroup.create_task, asyncio.create_task (GH-134202) (#134553)
gh-128307: Update docs for asyncio.create_task, TaskGroup.create_task, asyncio.create_task (GH-134202)
(cherry picked from commit a3d0306ca0)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2025-05-23 09:36:19 +05:30
Miss Islington (bot)
ee3a0efc9d
[3.14] Docs: fix link in free-threading-python.rst (GH-134548) (#134555) 2025-05-23 00:42:48 +00:00
Brett Cannon
8f4bf1538d
[3.14] GH-131769: fix detecting a pydebug build of the build Python when building for WASI (GH-133219) 2025-05-22 22:07:21 +00:00
Miss Islington (bot)
15e26eebf7
[3.14] GH-130397: remove special-casing of C stack depth for WASI (GH-134469) (GH-134547)
GH-130397: remove special-casing of C stack depth for WASI (GH-134469)

Removed special-casing for WASI when setting C stack depth limits. Since WASI has its own C stack checking this isn't a security risk.

Also disabled some tests that stopped passing. They all happened to have already been disabled under Emscripten.
(cherry picked from commit ad42dc1909)

Co-authored-by: Brett Cannon <brett@python.org>
2025-05-22 14:42:23 -07:00
Miss Islington (bot)
06a3a85f15
[3.14] Avoid __file__ in hashlib example (GH-134540) (#134549)
Avoid `__file__` in `hashlib` example (GH-134540)
(cherry picked from commit 9b292ff022)

Co-authored-by: Josh Cannon <joshdcannon@gmail.com>
2025-05-22 21:37:52 +00:00
Miss Islington (bot)
37c2c8c9d8
[3.14] Docs: Add note to tutorial clarifying scope (GH-134534) (#134536)
Docs: Add note to tutorial clarifying scope (GH-134534)

* Add note to tutorial

* Update formatting
(cherry picked from commit 742d5b5c5d)

Co-authored-by: Kattni <kattni@kattni.com>
2025-05-22 18:32:49 +00:00
Miss Islington (bot)
7480e50217
[3.14] gh-132775: Fix Recently Introduced Warnings (gh-134532)
(cherry picked from commit ac06b534ee, AKA gh-134530)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-22 17:49:05 +00:00
Miss Islington (bot)
04e2dd6513
[3.14] gh-132775: Make _PyXI_session Opaque (gh-134522)
This is mostly a refactor to clean things up a bit, most notably the "XI namespace" code.

Making the session opaque requires adding the following internal-only functions:

* _PyXI_NewSession()
* _PyXI_FreeSession()
* _PyXI_GetMainNamespace()

(cherry picked from commit 4a4ac3ab4d, gh-134452)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-22 17:12:52 +00:00
Miss Islington (bot)
068d570be8
[3.14] gh-134322: Fix repr(threading.RLock) (GH-134389) (#134528)
gh-134322: Fix `repr(threading.RLock)` (GH-134389)

Fix the `__repr__` value of `threading.RLock` from `_thread` module, when just created.
(cherry picked from commit fade146cfb)

Co-authored-by: Duprat <yduprat@gmail.com>
2025-05-22 17:12:21 +00:00
Miss Islington (bot)
bbf8048c0f
[3.14] gh-132775: Use _PyCode GetScriptXIData() (gh-134515)
(cherry picked from commit 09e72cf091, AKA gh-134511)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-22 15:07:11 +00:00
Miss Islington (bot)
c31b25c705
[3.14] gh-133740: Fix locale.nl_langinfo(ALT_DIGITS) (GH-134468) (#134512)
gh-133740: Fix locale.nl_langinfo(ALT_DIGITS) (GH-134468)

Set the LC_CTYPE locale to the LC_TIME locale even if
nl_langinfo(ALT_DIGITS) result is ASCII. The result is a list
separated by NUL characters and the code only checks the first list
item which can be ASCII whereas following items are non-ASCII.

Fix test__locale for the uk_UA locale on RHEL 7.
(cherry picked from commit 899c7dc283)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-22 14:31:26 +00:00
Miss Islington (bot)
ced49a196f
[3.14] gh-134323: Fix the new threading.RLock.locked method (GH-134368) (#134510)
gh-134323: Fix the new `threading.RLock.locked` method (GH-134368)
(cherry picked from commit 3effede97c)

Co-authored-by: Duprat <yduprat@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-22 14:14:53 +00:00