Commit graph

31380 commits

Author SHA1 Message Date
Miss Islington (bot)
7cb15f93fe
[3.14] gh-141659: Fix bad file descriptor error in subprocess on AIX (GH-141660) (GH-141738)
/proc/self does not exist on AIX.
(cherry picked from commit 92c5de73b8)

Co-authored-by: Ayappan Perumal <ayappap2@in.ibm.com>
2025-11-19 08:05:01 +00:00
Miss Islington (bot)
daff2a9c3c
[3.14] gh-141692: Add a slice-specific lib folder to iOS XCframeworks. (GH-141693) (#141733)
Modifies the iOS XCframework to include a lib folder for each slice that
contains a symlinked version of the libPython dynamic library.
(cherry picked from commit 7b0b708675)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-11-19 02:25:34 +00:00
Miss Islington (bot)
cf2524f2b7
[3.14] gh-141004: Document Py_MEMCPY (GH-141676) (GH-141685)
gh-141004: Document `Py_MEMCPY` (GH-141676)
(cherry picked from commit 16ea9505ce)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-17 22:57:47 +00:00
Miss Islington (bot)
060118ae91
[3.14] gh-141497: Make ipaddress.IP{v4,v6}Network.hosts() always returning an iterator (GH-141547) (GH-141673)
(cherry picked from commit 6b1bdf6c7a)

Co-authored-by: Krishna Chaitanya <141550576+XChaitanyaX@users.noreply.github.com>
2025-11-17 17:56:55 +00:00
Miss Islington (bot)
eead7b43bc
[3.14] gh-136057: Allow step and next to step over for loops (GH-136160) (#141640)
gh-136057: Allow step and next to step over for loops (GH-136160)
(cherry picked from commit 8be3b2f479)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2025-11-16 22:22:11 +00:00
Gregory P. Smith
0d8fb0b852
[3.14] gh-137109: refactor warning about threads when forking (GH-141438) (GH-141614)
This splits the OS API specific functionality to get the number of threads out
from the fallback Python method and warning raising code itself.  This way the
OS APIs can be queried before we've run
`os.register_at_fork(after_in_parent=...)` registered functions which
themselves may (re)start threads that would otherwise be detected.

This is best effort.  If the OS APIs are either unavailable or fail, the
warning generating code still falls back to looking at the Python threading
state after the CPython interpreter world has been restarted and the
after_in_parent calls have been made.  The common case for most Linux and macOS
environments should work today.

This also lines up with the existing TODO refactoring, we may choose to expose
this API to get the number of OS threads in the `os` module in the future.

Note: This is a simplified backport that maintains the void return type
for warn_about_fork_with_threads() and keeps PyErr_Clear() in the warning path,
as the error handling changes from fd8f42d3d1 are not needed in 3.14.
2025-11-16 19:45:29 +00:00
Tian Gao
58c9d25675
[3.14] gh-125115 : Refactor the pdb parsing issue so positional arguments can pass through (GH-140933) (#141635)
(cherry-picked from commit 5348c200f5)
2025-11-16 19:35:42 +00:00
Miss Islington (bot)
79c136f87b
[3.14] GH-141312: Allow only integers to longrangeiter_setstate state (GH-141317) (GH-141559)
This fixes an assertion error when the new computed start is not an integer.
(cherry picked from commit 10bec7c1eb)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
2025-11-15 21:30:25 +02:00
Sergey Miryanov
21e43d5e83
[3.14] GH-141509: Fix warning about remaining subinterpreters (GH-141528) (GH-141566)
(cherry picked from commit fa245df4a0)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-15 13:56:52 -05:00
Miss Islington (bot)
8a67e3c2b0
[3.14] gh-140938: Raise ValueError for infinite inputs to stdev/pstdev (GH-141531) (#141575)
gh-140938: Raise ValueError for infinite inputs to stdev/pstdev (GH-141531)

Raise ValueError for infinite inputs to stdev/pstdev
(cherry picked from commit f0a8bc737a)



---

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-14 18:58:40 -08:00
Miss Islington (bot)
17e7aad5e3
[3.14] gh-141579: Fix perf_jit backend in sys.activate_stack_trampoline() (GH-141580) (#141581)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-11-15 02:49:54 +00:00
Miss Islington (bot)
d582b6f1ab
[3.14] gh-136442: Fix unittest to return exit code 5 when setUpClass raises an exception (GH-136487) (#141576)
gh-136442: Fix unittest to return exit code 5 when setUpClass raises an exception (GH-136487)
(cherry picked from commit 53d65c840e)

Co-authored-by: Takuya UESHIN <ueshin@happy-camper.st>
2025-11-15 01:25:19 +00:00
Miss Islington (bot)
1cde019ecd
[3.14] gh-114203: skip locking if object is already locked by two-mutex critical section (GH-141476) (#141564)
gh-114203: skip locking if object is already locked by two-mutex critical section (GH-141476)
(cherry picked from commit f26ed455d5)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-11-14 18:38:30 +00:00
Miss Islington (bot)
959578e5d1
[3.14] gh-140691: urllib.request: Close FTP control socket if data socket can't connect (GH-140835) (GH-141555)
(cherry picked from commit f2bce51b98)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: codenamenam <bluetire27@gmail.com>
2025-11-14 17:27:33 +01:00
Miss Islington (bot)
dd28db664b
[3.14] gh-137969: Fix double evaluation of ForwardRefs which rely on globals (GH-140974) (#141527)
gh-137969: Fix double evaluation of `ForwardRef`s which rely on globals (GH-140974)
(cherry picked from commit 209eaff68c)

Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
2025-11-13 13:26:58 -08:00
Mikhail Efimov
af20b880fc
[3.14] gh-140104: Set next_instr properly in the JIT during exceptions (GH-140233) (GH-141495) 2025-11-13 18:47:25 +00:00
Miss Islington (bot)
79195df23c
[3.14] gh-140260: fix data race in _struct module initialization with subinterpreters (GH-140909) (#141501)
gh-140260: fix data race in `_struct` module initialization with subinterpreters (GH-140909)
(cherry picked from commit 63548b3699)

Co-authored-by: Shamil <ashm.tech@proton.me>
2025-11-13 17:23:22 +05:30
Miss Islington (bot)
7e9400c3e6
[3.14] gh-103847: fix cancellation safety of asyncio.create_subprocess_exec (GH-140805) (#141446)
gh-103847: fix cancellation safety of `asyncio.create_subprocess_exec` (GH-140805)
(cherry picked from commit ef474cfafb)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-11-13 17:03:04 +05:30
Miss Islington (bot)
0b44bc3379
[3.14] gh-124111: Fix TCL 9 thread detection (GH-141482)
(cherry picked from commit dc0987080e)

Co-authored-by: Michael Cho <michael@michaelcho.dev>
2025-11-12 22:43:31 +00:00
Miss Islington (bot)
4316180426
[3.14] gh-141442: Add escaping to iOS testbed arguments (GH-141443) (#141479)
Xcode concatenates the test argument array, losing quoting in the process.
(cherry picked from commit 558936bec1)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-11-12 22:15:34 +00:00
Mohsin Mehmood
92c14a91d2
[3.14] gh-141314: Fix TextIOWrapper.tell() assertion failure with standalone carriage return (GH-141331) (GH-141453)
The assertion was checking wrong variable (skip_back vs skip_bytes).
(cherry picked from commit af80fac425)
2025-11-12 12:40:02 +02:00
Miss Islington (bot)
e9c11b7495
[3.14] gh-141042: fix sNaN's packing for mixed floating-point formats (GH-141107) (#141459)
gh-141042: fix sNaN's packing for mixed floating-point formats (GH-141107)
(cherry picked from commit 23d85a2a3f)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-11-12 10:33:34 +00:00
Miss Islington (bot)
75b5157e84
[3.14] gh-141311: Avoid assertion in BytesIO.readinto() (GH-141333) (GH-141457)
Fix error in assertion which causes failure if pos is equal to PY_SSIZE_T_MAX.
Fix undefined behavior in read() and readinto() if pos is larger that the size
of the underlying buffer.
(cherry picked from commit 7d54374f9c)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-11-12 10:23:26 +00:00
Miss Islington (bot)
df045716e0
[3.14] GH-137618: Require Python 3.10 to Python 3.15 for PYTHON_FOR_REGEN (GH-137619) (#141437)
GH-137618: Require Python 3.10 to Python 3.15 for PYTHON_FOR_REGEN (GH-137619)

* Require Python 3.11 to Python 3.15 for PYTHON_FOR_REGEN

* NEWS

* keep allowing python 3.10

---------
(cherry picked from commit 9ce99c6c19)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-11-11 17:33:49 -08:00
Miss Islington (bot)
83c3eae099
[3.14] gh-138775: fix handle python -m base64 stdin correct with EOF signal (GH-138776) (#141432)
gh-138775: fix handle `python -m base64` stdin correct with EOF signal (GH-138776)

* fix: handle  stdin correct with EOF single.
* fix: flollow the comments when pipe stdin use buffer
* Apply suggestions from code review
* fix: apply review comments in Lib/base64.py
* fix: address comments
* Reword comment and NEWS entry.

---------
(cherry picked from commit f5c2a41f9a)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong <zouzou0208@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-11-12 00:12:57 +00:00
Miss Islington (bot)
6d31d085f0
[3.14] gh-140578: Doc: Remove sencence implying that concurrent.futures.ThreadPoolExecutor does not exist (GH-140689) (#141382)
gh-140578: Doc: Remove sencence implying that concurrent.futures.ThreadPoolExecutor does not exist (GH-140689)

* Doc: Remove sencence implying that concurrent.futures.ThreadPoolExecutor does not exist

Closes GH-140578

* Add NEWS.d entry for gh-140578

---------
(cherry picked from commit 46b58e1bb9)

Co-authored-by: Louis <paternal@users.noreply.github.com>
Co-authored-by: Louis Paternault <spalax@gresille.org>
2025-11-11 04:56:07 +00:00
Jelle Zijlstra
727cdcba8e
[3.14] gh-137530: generate an __annotate__ function for dataclasses __init__ (GH-137711) (#141352)
(cherry picked from commit 12837c6363)

Co-authored-by: David Ellis <ducksual@gmail.com>
2025-11-10 07:14:32 -08:00
Miss Islington (bot)
d7aace78e9
[3.14] gh-140530: fix a reference leak in an error path for raise exc from cause (GH-140908) (#141282)
gh-140530: fix a reference leak in an error path for `raise exc from cause` (GH-140908)

Fix a reference leak in `raise E from T` when `T` is an exception
subtype for which `T.__new__` does not return an exception instance.
(cherry picked from commit 0c77e7c23b)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-09 17:04:26 +01:00
Miss Islington (bot)
d6b4f4b10f
[3.14] gh-100218: correctly set errno when socket.if_{nametoindex,indextoname} raise OSError (GH-140905) (#141284)
gh-100218: correctly set `errno` when `socket.if_{nametoindex,indextoname}` raise `OSError` (GH-140905)

Previously, socket.if_nametoindex() and socket.if_indextoname() could raise
an `OSError` with a `None` errno. Now, the errno from libc is propagated.
(cherry picked from commit 3ce2d57b2f)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-09 13:11:43 +00:00
Miss Islington (bot)
d729087c06
[3.14] gh-139246: zero-width word paste can be wrong in default repl (GH-139254) (GH-140796)
gh-139246: zero-width word paste can be wrong in default repl (GH-139254)

(cherry picked from commit 4e6dba0ef7)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong <zouzou0208@gmail.com>
Co-authored-by: grayjk <grayjk@gmail.com>
2025-11-07 13:50:06 +01:00
Miss Islington (bot)
cb8b2bad34
[3.14] gh-141141: Make base64.b85decode() thread safe (GH-141149) (GH-141184)
(cherry picked from commit a7bf27f7f5)

Co-authored-by: Benel Tayar <86257734+beneltayar@users.noreply.github.com>
2025-11-07 11:14:51 +00:00
Miss Islington (bot)
cf48ead02b
[3.14] gh-140734: fix off-by-one error when comparing to _SUN_PATH_MAX (GH-140903) (#141181)
gh-140734: fix off-by-one error when comparing to `_SUN_PATH_MAX` (GH-140903)

The limit includes a NULL terminator.
(cherry picked from commit 9a19900673)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-07 10:27:14 +00:00
Stan Ulbrych
ebf54596bf
[3.14] gh-140939: Fix memory leak in _PyBytes_FormatEx error path (GH-140957) (#141154)
(cherry picked from commit d6c89a2df2)
2025-11-06 16:20:03 +00:00
Hugo van Kemenade
7168553c00
[3.14] gh-138189: Document type slots, and other constants, as part of Limited API (GH-138190) (GH-141131)
(cherry picked from commit d81e1ef0f3)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-06 12:39:19 +01:00
Chris Eibl
f0eb7d4c9a
[3.14] gh-140513: Fail to compile if _Py_TAIL_CALL_INTERP is set but preserve_none and musttail do not exist (GH-140548) (#140923)
gh-140513: Fail to compile if `_Py_TAIL_CALL_INTERP` is set but `preserve_none` and `musttail` do not exist. (GH-140548)


(cherry picked from commit 2f60b8f02f)

Co-authored-by: Krishna Chaitanya <141550576+XChaitanyaX@users.noreply.github.com>
2025-11-04 20:43:18 +00:00
Miss Islington (bot)
e5266fcac8
[3.14] gh-140797: Forbid capturing groups in re.Scanner lexicon patterns (GH-140944) (GH-140982)
(cherry picked from commit fa9c3eefd4)

Co-authored-by: Abhishek Tiwari <Abhi210@users.noreply.github.com>
2025-11-04 11:21:33 +00:00
Miss Islington (bot)
331b4b868c
[3.14] gh-140815: Fix faulthandler for invalid/freed frame (GH-140921) (#140981)
gh-140815: Fix faulthandler for invalid/freed frame (GH-140921)

faulthandler now detects if a frame or a code object is invalid or
freed.

Add helper functions:

* _PyCode_SafeAddr2Line()
* _PyFrame_SafeGetCode()
* _PyFrame_SafeGetLasti()

_PyMem_IsPtrFreed() now detects pointers in [-0xff, 0xff] range
as freed.
(cherry picked from commit a84181c31b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-04 11:18:23 +00:00
Miss Islington (bot)
08012a93a8
[3.14] gh-138151: Fix annotationlib handling of multiple nonlocals (GH-138164) (#140949)
gh-138151: Fix annotationlib handling of multiple nonlocals (GH-138164)
(cherry picked from commit b1027d4762)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-11-03 15:52:01 +00:00
Miss Islington (bot)
788104633c
[3.14] gh-140348: Fix using | on unusual objects plus Unions (GH-140383) (#140948)
gh-140348: Fix using | on unusual objects plus Unions (GH-140383)
(cherry picked from commit 7a9437d986)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-11-03 15:16:03 +00:00
Jelle Zijlstra
1b376b82ac
[3.14] Revert "gh-137969: Fix evaluation of ref.evaluate(format=Format.FORWARDREF) objects (GH-138075) (#140929)" (GH-140931)
Revert "[3.14] gh-137969: Fix evaluation of `ref.evaluate(format=Format.FORWARDREF)` objects (GH-138075) (#140929)"

This reverts commit cdb6fe89ae.
2025-11-03 15:07:22 +01:00
Miss Islington (bot)
cdb6fe89ae
[3.14] gh-137969: Fix evaluation of ref.evaluate(format=Format.FORWARDREF) objects (GH-138075) (#140929)
gh-137969: Fix evaluation of `ref.evaluate(format=Format.FORWARDREF)` objects (GH-138075)
(cherry picked from commit 63e01d6bae)

Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-11-03 01:45:44 +00:00
Miss Islington (bot)
23e3771045
[3.14] gh-138425: Correctly partially evaluate global generics with undefined params in ref.evaluate(format=Format.FORWARDREF) (GH-138430) (#140927)
gh-138425: Correctly partially evaluate global generics with undefined params in `ref.evaluate(format=Format.FORWARDREF)` (GH-138430)
(cherry picked from commit e66f87ca73)

Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-11-02 23:41:49 +00:00
Miss Islington (bot)
7e1bac6a1a
[3.14] gh-135307: Fix email error when policy max_line_length is set to 0 or None (GH-135367) (#140915)
gh-135307: Fix email error when policy max_line_length is set to 0 or None (GH-135367)
(cherry picked from commit 6d45cd8dbb)


RDM: Like the change made in a earlier PR to the folder, we can/must use 'maxlen' as a stand in for 'unlimited' when computing line lengths when max_line_length is 0 or None; otherwise the computation results in a traceback.

Co-authored-by: Jiucheng(Oliver) <git.jiucheng@gmail.com>
2025-11-02 10:03:12 -05:00
Bénédikt Tran
bf2865f80f
[3.14] gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (GH-139234) (#139359)
* [3.14] gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (GH-139234)

Expose the XML Expat 2.7.2 mitigation APIs to disallow use of
disproportional amounts of dynamic memory from within an Expat
parser (see CVE-2025-59375 for instance).

The exposed APIs are available on Expat parsers, that is,
parsers created by `xml.parsers.expat.ParserCreate()`, as:

- `parser.SetAllocTrackerActivationThreshold(threshold)`, and
- `parser.SetAllocTrackerMaximumAmplification(max_factor)`.

(cherry picked from commit f04bea44c3)
(cherry picked from commit 68a1778b77)
2025-11-02 09:33:36 +00:00
Ken Jin
4d68b758fa
[3.14] gh-140104: Revert "Set next_instr properly in the JIT during exceptions (GH-140233) (GH-140687)" (#140890)
Revert "[3.14] gh-140104: Set next_instr properly in the JIT during exceptions (GH-140233) (GH-140687)"

This reverts commit 2e21672803.
2025-11-01 18:41:01 +00:00
Miss Islington (bot)
c7ede76d8e
[3.14] gh-140874: Upgrade bundled pip to 25.3 (GH-140876) (gh-140881)
gh-140874: Upgrade bundled pip to 25.3 (GH-140876)

Upgrade bundled pip to 25.3
(cherry picked from commit d440a0f96c)

Co-authored-by: Damian Shaw <damian.peter.shaw@gmail.com>
2025-11-01 11:21:51 +00:00
Łukasz Langa
631ba3407e
[3.14] gh-136065: Fix quadratic complexity in os.path.expandvars() (GH-134952) (GH-140844)
(cherry picked from commit f029e8db62)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-31 17:43:23 +01:00
Miss Islington (bot)
89818a5939
[3.14] gh-137836: Support more RAWTEXT and PLAINTEXT elements in HTMLParser (GH-137837) (GH-140841)
* the "plaintext" element
* the RAWTEXT elements "xmp", "iframe", "noembed" and "noframes"
* optionally RAWTEXT (if scripting=True) element "noscript"
(cherry picked from commit a17c57eee5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-31 16:13:13 +00:00
Brian Schubert
d0c78a458b
[3.14] gh-138944: Fix SyntaxError message for invalid syntax following valid import-as statement (GH-138945) (#140646)
(cherry picked from commit 3dab11f888)
2025-10-31 11:26:40 +01:00
Mikhail Efimov
5954b5ba92
[3.14] gh-140551: Fix dict crash if clear is called at lookup stage (GH-140558) (#140743)
gh-140551: Fix `dict` crash if `clear` is called at `lookup` stage (#140558)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2025-10-30 22:33:35 +05:30