Commit graph

127576 commits

Author SHA1 Message Date
Miss Islington (bot)
d851f8e258
[3.14] gh-135462: Fix quadratic complexity in processing special input in HTMLParser (GH-135464) (GH-135481)
End-of-file errors are now handled according to the HTML5 specs --
comments and declarations are automatically closed, tags are ignored.
(cherry picked from commit 6eb6c5dbfb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-13 17:23:48 +00:00
Miss Islington (bot)
b573a850d6
[3.14] doc: Remove what was essentially duplicate wording. (GH-135431) (GH-135440)
(cherry picked from commit f273fd77d7)
2025-06-13 17:54:20 +01:00
Miss Islington (bot)
5912979975
gh-135455: Fix version and architecture detection in PC/layout script. (GH-135461)
(cherry picked from commit afc5ab6cce)

Co-authored-by: Steve Dower <steve.dower@python.org>
2025-06-13 16:10:29 +00:00
Miss Islington (bot)
a9db299afa
[3.14] gh-106318: Add example for str.expandtabs() (GH-134525) (#135476)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
2025-06-13 15:50:16 +00:00
Miss Islington (bot)
46e7ed7206
[3.14] gh-135244: improve wording of uuid8 docs about CSPRNG (GH-135433) (#135467)
gh-135244: improve wording of `uuid8` docs about CSPRNG (GH-135433)
(cherry picked from commit 394d7985da)

Co-authored-by: LamentXU <108666168+LamentXU123@users.noreply.github.com>
2025-06-13 14:11:51 +00:00
Miss Islington (bot)
6754a507c5
[3.14] gh-132969: Fix error/hang when shutdown(wait=False) and task exited abnormally (GH-133222) (GH-135344)
gh-132969:  Fix error/hang when shutdown(wait=False) and task exited abnormally (GH-133222)

When shutdown is called with wait=False, the executor thread keeps running
even after the ProcessPoolExecutor's state is reset. The executor then tries
to replenish the worker processes pool resulting in an error and a potential hang
when it comes across a worker that has died. Fixed the issue by having
_adjust_process_count() return without doing anything if the ProcessPoolExecutor's
state has been reset.

Added unit tests to validate two scenarios:
max_workers < num_tasks (exception)
max_workers > num_tasks (exception + hang)
(cherry picked from commit 598aa7cc98)

Co-authored-by: Ajay Kamdar <140011370+ogbiggles@users.noreply.github.com>
2025-06-13 15:49:54 +02:00
Miss Islington (bot)
8a78ee6d8d
[3.14] gh-106318: Add example for str.endswith() (GH-134523) (#135459)
gh-106318: Add example for `str.endswith()` (GH-134523)
(cherry picked from commit eed827ed09)

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-13 15:14:21 +03:00
Miss Islington (bot)
f22aae1908
[3.14] gh-106318: Add example for str.encode() (GH-134520) (#135457)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-13 14:46:06 +03:00
Miss Islington (bot)
b3efd3d7d3
[3.14] Revert "gh-135410: use a critical section around StringIO.__next__ (GH-135412)" (GH-135439) (gh-135449)
Revert "gh-135410: use a critical section around `StringIO.__next__` (GH-135412)" (GH-135439)

This reverts commit e6c3039cb3.
(cherry picked from commit 73431356d3)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-06-12 22:58:58 +00:00
Miss Islington (bot)
f885c7d9b9
[3.14] gh-135429: Fix the argument mismatch in lsprof throw event (GH-135442) (#135446)
gh-135429: Fix the argument mismatch in lsprof throw event (GH-135442)
(cherry picked from commit b03309fe5f)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2025-06-12 22:13:36 +00:00
Eric Snow
04273adae0
[3.14] gh-134939: Add the concurrent.interpreters Module (gh-135414)
PEP-734 has been accepted (for 3.14).

(FTR, I'm opposed to putting this under the concurrent package, but
doing so is the SC condition under which the module can land in 3.14.)

(cherry picked from commit 62143736b, AKA gh-133958)
2025-06-12 08:19:26 -06:00
Miss Islington (bot)
8cb7d9a810
[3.14] gh-135410: use a critical section around StringIO.__next__ (GH-135412) (#135425)
gh-135410: use a critical section around `StringIO.__next__` (GH-135412)
(cherry picked from commit e6c3039cb3)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-06-12 11:36:44 +00:00
Miss Islington (bot)
e76dbc87a2
[3.14] gh-128627: Fix iPad detection in wasm-gc (GH-135388) (#135419)
On some iPad versions, Safari reports as "macOS". Modifies the GC trampoline detection
to add a feature-based check to detect this case.
(cherry picked from commit d447129758)

Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
2025-06-12 04:28:47 +00:00
Miss Islington (bot)
4a30154fd2
[3.14] Fix presentation of dataclasses' unsafe_hash default value (GH-116532) (#135416)
Fix presentation of dataclasses' `unsafe_hash` default value (GH-116532)

(cherry picked from commit 71f5fafdfb)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-06-12 01:36:17 +00:00
Miss Islington (bot)
98136ddb0e
[3.14] gh-133264: Correct documentation of how Py_Main and Py_RunMain handle SystemExit (GH-135337) (#135394)
gh-133264: Correct documentation of how Py_Main and Py_RunMain handle SystemExit (GH-135337)
(cherry picked from commit b706ff003c)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-06-11 15:29:46 +00:00
Miss Islington (bot)
0e969fe843
[3.14] gh-135321: Always raise a correct exception for BINSTRING argument > 0x7fffffff in pickle (GH-135322) (GH-135382)
(cherry picked from commit 2b8b4774d2)

Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-11 14:01:15 +03:00
Miss Islington (bot)
30494cc72c
[3.14] gh-133967: Do not normalize locale name 'C.UTF-8' to 'en_US.UTF-8' (GH-135347) (GH-135349)
(cherry picked from commit 0f866cbfef)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-11 12:43:20 +03:00
Miss Islington (bot)
9f6c3769e3
[3.14] gh-135326: Test support of __index__ in random.getrandbits() (GH-135356) (#135373)
gh-135326: Test support of __index__ in random.getrandbits() (GH-135356)
(cherry picked from commit 5ae669fc4e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-11 02:17:06 +00:00
Miss Islington (bot)
f303532857
[3.14] gh-91048: Reorder result tuple of parse_code_object (GH-134898) (#134956)
* gh-91048:  Reorder result tuple of parse_code_object (GH-134898)

Reorder result tuple of parse_code_object

The standard followed by APIs like pstat.Stats is to take a file, line,
function triplet. The parse_code_object function (and callers exposing
this in Python like RemoteUnwinder.get_stack_trace) return function,
file, line triplets which requires the caller to reorder these when
using it in classes like pstat.Stats.
(cherry picked from commit 8e8786f898)

Co-authored-by: László Kiss Kollár <kiss.kollar.laszlo@gmail.com>

* Reorder asyncio

---------

Co-authored-by: László Kiss Kollár <kiss.kollar.laszlo@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2025-06-11 01:33:46 +00:00
Miss Islington (bot)
77c4b5d413
[3.14] gh-130077: Properly match full soft keywords in the parser (GH-135317) (#135348)
gh-130077: Properly match full soft keywords in the parser (GH-135317)
(cherry picked from commit ff2b5f40c2)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-06-11 02:01:37 +01:00
stratakis
4b96a34978
[3.14] gh-128605: Add branch protections for x86_64 in asm_trampoline.S (#128606) (#135345)
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-10 17:41:39 +02:00
Miss Islington (bot)
081421a00e
[3.14] gh-118928: Amend sqlite3 execute*() deprecation notes (GH-135163) (#135342)
(cherry picked from commit ee7345d507)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2025-06-10 11:30:19 +00:00
Miss Islington (bot)
88d8a2e9f0
[3.14] Docs: fix docstring of email.message.Message.add_header (GH-134355) (#135339)
Docs: fix docstring of `email.message.Message.add_header` (GH-134355)
(cherry picked from commit c23eec2960)

Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
2025-06-10 11:00:25 +00:00
Miss Islington (bot)
904685f90f
[3.14] gh-133157: remove usage of _Py_NO_SANITIZE_UNDEFINED in Parser/pegen.c (GH-134048) (#135320)
gh-133157: remove usage of `_Py_NO_SANITIZE_UNDEFINED` in `Parser/pegen.c` (GH-134048)
(cherry picked from commit 754e7c9b51)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-10 00:34:49 +00:00
Miss Islington (bot)
84c6fe6ac6
[3.14] Fix warnings set but not used [-Wunused-but-set-variable] in remote_debug.h (GH-135290) (#135319)
Fix warnings `set but not used [-Wunused-but-set-variable]` in remote_debug.h (GH-135290)
(cherry picked from commit 49fc1f215a)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-06-10 00:29:28 +00:00
Miss Islington (bot)
79c86b118c
[3.14] Fix definition of _Py_RemoteDebug_ symbols for static linking (GH-135146) (#135318)
Fix definition of `_Py_RemoteDebug_` symbols for static linking (GH-135146)
(cherry picked from commit 2e1ad6eb26)

Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-06-10 00:28:42 +00:00
Miss Islington (bot)
e5a154786b
[3.14] Heavily comment Python/perf_jit_trampoline.c to improve maintainability (GH-134527) (#135299) 2025-06-09 22:09:48 +01:00
Miss Islington (bot)
8b35651853
[3.14] gh-127833: Reword and expand the Notation section (GH-134443) (GH-135301)
Prepare the docs for using the notation used in the `python.gram`
file. If we want to sync the two, the meta-syntax should be the same.

Link the Full Grammar docs here; keep only a few extras.

Also, remove the distinction between lexical and syntactic rules,
except for whitespace handling.
With f- and t-strings, the line between the two is blurry.
(cherry picked from commit 28d91d06f1)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Colin Marquardt <cmarqu42@gmail.com>
2025-06-09 13:56:24 +00:00
Miss Islington (bot)
725ec53032
[3.14] bpo-45210: Document that error indicator may be set in tp_dealloc (GH-28358) (#135298)
bpo-45210: Document that error indicator may be set in tp_dealloc (GH-28358)
(cherry picked from commit 8441b263af)

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Co-authored-by: Edward Z. Yang <ezyang@mit.edu>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-09 13:01:33 +00:00
Victor Stinner
3d69d18322
[3.14] gh-133968: Add PyUnicodeWriter_WriteASCII() function (#133973) (#134974)
gh-133968: Add PyUnicodeWriter_WriteASCII() function (#133973)

Replace most PyUnicodeWriter_WriteUTF8() calls with
PyUnicodeWriter_WriteASCII().

(cherry picked from commit f49a07b531)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-09 14:37:26 +02:00
Miss Islington (bot)
dba307a757
[3.14] GH-135287: clang-cl PGO builds on Windows fail with could not open '/GENPROFILE' (GH-135289)
GH-135287: clang-cl PGO builds on Windows fail with `could not open '/GENPROFILE'` (GH-135289)
(cherry picked from commit 0045100ccb)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-06-09 12:18:51 +00:00
Mark Shannon
a5274cd215
[3.14] GH-135171: Fix generator expressions one last time (hopefully) (GH-135225)
* Add NULL check to FOR_ITER

* Move GET_ITER back to genexpr creation
2025-06-09 11:04:23 +01:00
Miss Islington (bot)
1497866198
[3.14] Use f-strings in csv docs example (GH-135245) (#135285)
Use f-strings in csv docs example (GH-135245)
(cherry picked from commit 2677dd017a)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2025-06-09 06:37:15 +00:00
Miss Islington (bot)
7bb999d431
[3.14] gh-135263: Fix typo in token.NAME documentation (GH-135275) (#135280)
gh-135263: Fix typo in token.NAME documentation (GH-135275)
(cherry picked from commit 8d17a412da)

Co-authored-by: Vladyslav Lazoryk <80263725+lazorikv@users.noreply.github.com>
2025-06-08 17:55:04 -04:00
Miss Islington (bot)
00f824dc5a
[3.14] gh-135276: Refresh zipfile.Path from zipp 3.23 (GH-135277) (#135278)
* gh-135276: Refresh `zipfile.Path` from zipp 3.23 (GH-135277)

Apply changes from zipp 3.23
(cherry picked from commit 8d6eb0c262)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

* Removed features slated for Python 3.15 only.

---------

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2025-06-08 20:12:25 +00:00
Miss Islington (bot)
cf2209f5b9
[3.14] Update tutorial for new "Copy" button (GH-135007) (#135270)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-06-08 16:40:07 +00:00
Miss Islington (bot)
483a462580
[3.14] gh-134976: document the exception type that can be raised by s[i] (GH-134977) (#135258)
gh-134976: document the exception type that can be raised by `s[i]` (GH-134977)
(cherry picked from commit 158e5162bf)

Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
2025-06-08 14:37:29 +02:00
Miss Islington (bot)
949248d6db
[3.14] gh-135244: generate UUID random Node ID with a CSPRNG as per RFC 9562, §6.10.3 (GH-135226) (#135255)
gh-135244: generate UUID random Node ID with a CSPRNG as per RFC 9562, §6.10.3 (GH-135226)

This aligns with the recommendations of RFC 9562, Section 6.10, paragraph 3 [1].

[1]: https://www.rfc-editor.org/rfc/rfc9562.html#section-6.10-3.

---------
(cherry picked from commit 1cb7163872)

Co-authored-by: LamentXU <108666168+LamentXU123@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-08 12:13:04 +00:00
Miss Islington (bot)
85efa77e35
[3.14] gh-134151 Fix TypeError in email.utils.decode_params when sorting RFC 2231 continuations (GH-134687) (#135247)
gh-134151 Fix `TypeError` in `email.utils.decode_params` when sorting RFC 2231 continuations (GH-134687)

- Fix sorting logic in `email.utils.decode_params` to handle None values.
- Update tests for RFC 2231 continuation sorting.
(cherry picked from commit bcb6b45cb8)

Co-authored-by: Jiucheng(Oliver) <git.jiucheng@gmail.com>
2025-06-08 07:38:39 +00:00
Miss Islington (bot)
ef539654e6
[3.14] gh-134876: Add fallback for when process_vm_readv fails with ENOSYS (GH-134878) (#135240)
gh-134876: Add fallback for when process_vm_readv fails with ENOSYS (GH-134878)
(cherry picked from commit ac9c3431cc)

Co-authored-by: Daniel Golding <goldingd89@gmail.com>
2025-06-07 18:56:38 +00:00
Miss Islington (bot)
3faf00e003
[3.14] gh-134155: fix AttributeError in email._header_value_parser.get_address (GH-134194) (#135191)
gh-134155: fix AttributeError in email._header_value_parser.get_address (GH-134194)

Append the defect to defects instead of to the parse tree.
(cherry picked from commit d9cad074d5)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
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-06 14:13:30 -04:00
Miss Islington (bot)
88b5784fc0
[3.14] Docs: Update PyExc_* tables in the c-api documentation (GH-131640) (GH-135220)
Docs: Update `PyExc_*` tables in the c-api documentation (GH-131640)

Add `PyExc_BaseExceptionGroup` and `PyExc_EncodingWarning`
(cherry picked from commit f00512db20)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-06-06 15:57:37 +00:00
Miss Islington (bot)
dd4a819a82
[3.14] gh-134160: Use PyModuleDef.m_free in the example module xxlimited (GH-135174) (GH-135213)
gh-134160: Use PyModuleDef.m_free in the example module xxlimited (GH-135174)
(cherry picked from commit 1adca08d65)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2025-06-06 17:08:45 +02:00
Miss Islington (bot)
f32c7b9100
[3.14] gh-57089: Note _layout_ in the bitfield docs (GH-134148) (GH-135216)
(cherry picked from commit b22b964a5c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Meador Inge <meadori@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-06-06 14:58:48 +00:00
Miss Islington (bot)
23552b3d8f
[3.14] feat(docs): type fix - apply pep8 by using docstring instead of comment in the doc. (GH-135181) (#135212)
feat(docs): type fix - apply pep8 by using docstring instead of comment in the doc. (GH-135181)

Giving the right example incitates the tutorial readers to do the same in the future.
(cherry picked from commit 343182853f)

Co-authored-by: Jean-Louis GUENEGO <jlguenego@gmail.com>
2025-06-06 13:22:50 +00:00
Serhiy Storchaka
5b38af57e0
[3.14] gh-135120: Add test.support.subTests() (GH-135121) (GH-135208)
(cherry picked from commit 6ef06fad84)
2025-06-06 13:03:28 +00:00
Miss Islington (bot)
4e2e02eec9
[3.14] gh-134993: Add os.lstat() to os.supports_dir_fd (GH-135188) (#135205)
gh-134993: Add os.lstat() to os.supports_dir_fd (GH-135188)
(cherry picked from commit e004cf8fd5)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-06 12:38:59 +00:00
Miss Islington (bot)
daf11fca03
[3.14] Fix versionadded directive rendering in c-api/arg.rst (GH-135199) (#135207)
Fix versionadded directive rendering in c-api/arg.rst (GH-135199)
(cherry picked from commit 39859fcac5)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-06-06 12:30:33 +00:00
Petr Viktorin
b477e21d5c
[3.14] gh-128605: Revert "Add branch protections for x86_64 in asm_tr…ampoline.S (#128606) (#135077)" (GH-135175)
This reverts commit 899cca6dbf,
which broke buildbots.
2025-06-06 13:55:26 +02:00
Miss Islington (bot)
897b81500c
[3.14] gh-135155: Added dependencies required for compiling the _zstd module (GH-135156) (#135197)
gh-135155: Added dependencies required for compiling the _zstd module (GH-135156)
(cherry picked from commit a7d41e8aab)

Co-authored-by: Weipeng Hong <hongweichen8888@sina.com>
2025-06-06 01:09:08 +00:00