128771 Commits

Author SHA1 Message Date
Miss Islington (bot)
0e2ed4b0e1
[3.14] gh-143191: Use _PyOS_MIN_STACK_SIZE in _thread.stack_size() (GH-143601) (#143611)
gh-143191: Use _PyOS_MIN_STACK_SIZE in _thread.stack_size() (GH-143601)

The stack size must be at least _PyOS_MIN_STACK_SIZE+SYSTEM_PAGE_SIZE
bytes.
(cherry picked from commit ba10100c3931b18812b82d7124e2238f01927910)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-09 15:34:39 +00:00
Miss Islington (bot)
426683e7b7
[3.14] gh-106318: Add examples for str.rfind() method (GH-143582) (#143616)
gh-106318: Add examples for str.rfind() method (GH-143582)
(cherry picked from commit c696f33d9ee425d7acd5de90d5418a3280444962)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2026-01-09 15:30:11 +00:00
Miss Islington (bot)
ae62d2bb31
[3.14] gh-106318: Improve str.removeprefix() and str.removesuffix() docs (GH-143580) (#143614)
gh-106318: Improve str.removeprefix() and str.removesuffix() docs (GH-143580)

Add doctest role and 'See also'.
(cherry picked from commit 6d6c7ed73786915d16f6ac3d8b6e6d67f404209f)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2026-01-09 15:28:36 +00:00
Victor Stinner
1d0baf1ae4
[3.14] gh-143547: Fix PyErr_FormatUnraisable() fallback (#143557) (#143603)
gh-143547: Fix PyErr_FormatUnraisable() fallback (#143557)

Hold a strong reference to 'hook' while calling the default
unraisable took to log hook failure.

(cherry picked from commit 39a2bcf949095bd603f7b73f15b5b478dbb49ba9)
2026-01-09 16:10:50 +01:00
Miss Islington (bot)
f264f103d4
[3.14] gh-143378: Fix use-after-free when BytesIO is concurrently mutated during write operations (GH-143408) (GH-143599)
PyObject_GetBuffer() can execute user code (e.g. via __buffer__), which may
close or otherwise mutate a BytesIO object while write() or writelines()
is in progress. This could invalidate the internal buffer and lead to a
use-after-free.

Ensure that PyObject_GetBuffer() is called before validation checks.
(cherry picked from commit 6d54b6ac7d5744e1f59d784c8e020d632d2959a3)

Co-authored-by: zhong <60600792+superboy-zjc@users.noreply.github.com>
2026-01-09 12:16:51 +00:00
Miss Islington (bot)
a299c1b185
[3.14] gh-143429: Use compile-time NaN encoding detection for test_struct (GH-143432) (#143595)
gh-143429: Use compile-time NaN encoding detection for test_struct (GH-143432)
(cherry picked from commit dcdb23f9db2bd683e5d37558f09b458be25a9b4d)

Co-authored-by: Henry Chen <chenx97@aosc.io>
2026-01-09 12:32:49 +01:00
Miss Islington (bot)
0f02dbe4ab
[3.14] gh-142095: Use thread local frame info in py-bt and py-bt-full when available (gh-143371) (#143566)
In optimized and `-Og` builds, arguments and local variables are frequently
unavailable in gdb. This makes `py-bt` fail to print anything useful. Use the
`PyThreadState*` pointers `_Py_tss_gilstate` and `Py_tss_tstate` to find the
interpreter frame if we can't get the frame from the
`_PyEval_EvalFrameDefault` call.
(cherry picked from commit 49c3b0a67a77bb42e736cea7dcbc1aa8fa704074)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-08 12:35:31 -05:00
Miss Islington (bot)
335c83ed28
[3.14] gh-143553: Add support for parametrized resources in regrtests (GH-143554) (GH-143555)
For example, "-u xpickle=2.7" will run test_xpickle only against Python 2.7.
(cherry picked from commit c07e5ec0a9e5843fc39dec6aa94172faf6354858)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-08 18:12:33 +02:00
Miss Islington (bot)
6c6eb7abe5
[3.14] gh-143513: Clarify changed argument name of ResourceReader.is_resource (GH-143523) (GH-143562)
gh-143513: Clarify changed argument name of `ResourceReader.is_resource` (GH-143523)
(cherry picked from commit 5462002bbefd6cb79716828051beae94de8f2529)

Co-authored-by: Alex Willmer <alex@moreati.org.uk>
2026-01-08 13:45:57 +00:00
Miss Islington (bot)
fd430f89f9
[3.14] gh-143528: Fix test_time.test_thread_time() (GH-143558) (#143559)
gh-143528: Fix test_time.test_thread_time() (GH-143558)

Tolerate 100 ms instead of 20 ms to support slow CIs.
(cherry picked from commit efaa56f73cb1dc4863894444425e753afb7b997c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-08 13:31:18 +00:00
Miss Islington (bot)
de53bf4168
[3.14] gh-143089: Fix ParamSpec default examples to use list instead of tuple (GH-143179) (#143538)
Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
2026-01-08 11:49:41 +00:00
Miss Islington (bot)
e8ac4271b1
[3.14] gh-143517: Fix an edge case in rewriting stringified starred annotations (GH-143518) (#143540)
gh-143517: Fix an edge case in rewriting stringified starred annotations (GH-143518)
(cherry picked from commit 6c9f7b4406d507625ff414cddc549d4c630c59c5)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2026-01-08 04:07:23 +00:00
Miss Islington (bot)
9ab5a24d86
[3.14] Fix a typo in STORE_SLICE docs (GH-143500) (#143533)
Fix a typo in STORE_SLICE docs (GH-143500)
(cherry picked from commit 228d95582e080c60335d5f0a229a6698eb69b11c)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2026-01-07 22:42:12 +00:00
Miss Islington (bot)
76afbe2747
[3.14] gh-106318: Add examples for str.casefold() and str.lower() methods (GH-142154) (#143524)
gh-106318: Add examples for str.casefold() and str.lower() methods (GH-142154)
(cherry picked from commit 51a56a3a7bd8cf05ceda65e843fb7bae40509799)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-01-07 18:03:20 +01:00
Miss Islington (bot)
63f8a863d1
[3.14] gh-138568: Make help mode in PyREPL not exit on empty line input (GH-143512) (GH-143519)
(cherry picked from commit b3e4a3462f6011cacdfc58c565c69e4d7de6b9cd)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: yihong0618 <zouzou0208@gmail.com>
2026-01-07 17:06:53 +01:00
Miss Islington (bot)
fcd9500c53
[3.14] gh-142991: socketmodule: fixed getsockaddrlen() for PF_DIVERT socket (GH-142993) (#143481)
gh-142991: socketmodule: fixed getsockaddrlen() for PF_DIVERT socket (GH-142993)
(cherry picked from commit 05406b221dc9d5946c60253392788d60f1f08c8b)

Co-authored-by: Gleb Smirnoff <glebius@FreeBSD.org>
2026-01-07 14:20:07 +00:00
Miss Islington (bot)
ad53bf5fd7
[3.14] gh-75572: Fix test_xpickle and disable it by default (GH-143503) (GH-143505)
(cherry picked from commit b866a1c73f81606475456dbe8a7620c225fdc718)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-07 09:21:45 +02:00
Miss Islington (bot)
951bb2ab4b
[3.14] gh-106318: Add example for str.index() (GH-137023) (#143502)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2026-01-06 21:48:19 +00:00
Miss Islington (bot)
b0eb1980bb
[3.14] gh-133315: Document that compat32 should not be used with MIMEPart/EmailMessage (GH-143307) (#143496)
gh-133315: Document that compat32 should not be used with MIMEPart/EmailMessage (GH-143307)
(cherry picked from commit ff7d1cec41f391270560b9f4726791d8476c6eba)

Co-authored-by: Andrii Hrimov <andrew.hrimov@gmail.com>
2026-01-06 15:33:31 -05:00
Miss Islington (bot)
66d38b326f
[3.14] Doc: Fix missing closing parenthesis in argparse example (GH-143488) (#143489)
Doc: Fix missing closing parenthesis in argparse example (GH-143488)
(cherry picked from commit 51227b6b1a9181ef4da10811e7b5a55474fc4378)

Co-authored-by: Xiao Yuan <yuanx749@gmail.com>
2026-01-06 17:59:49 +00:00
Miss Islington (bot)
98128451ea
[3.14] gh-75572: Forward-port test_xpickle from Python 2 to 3 (GH-22452) (GH-143485)
Move data classes used in tests to separate file test_picklecommon.py,
so it can be imported in old Python versions.
(cherry picked from commit 8735daf3e82d50defd791e9be7b9ae6843bc4ed1)

Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-06 17:28:56 +00:00
Miss Islington (bot)
22a99ca8e1
[3.14] gh-142302: Fix mkstemp() documentation: clarify file descriptor inheritance behavior (GH-142338) (#143486)
gh-142302: Fix mkstemp() documentation: clarify file descriptor inheritance behavior (GH-142338)

The documentation incorrectly stated that the file descriptor is not
inherited by child processes. In reality, the close-on-exec flag (when
available) only prevents inheritance across exec() calls, not fork().
(cherry picked from commit e79c9b703117d8b0e7c4d86b704e2e7f120db883)

Co-authored-by: ADITYA RAI <adi.hack1234@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-06 17:14:12 +00:00
Miss Islington (bot)
b9b2b3d86a
[3.14] gh-106318: Add examples for str.isprintable() (GH-140043) (#143483)
gh-106318: Add examples for str.isprintable()  (GH-140043)
(cherry picked from commit 7b0a372b20ae3b80053d52e84c2b7bdd114c19f0)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-01-06 16:49:41 +00:00
Miss Islington (bot)
45da8f081d
[3.14] gh-136282: Configparser: create unnamed sections via mapping protocol access (GH-136313) (GH-142978)
(cherry picked from commit 4aef13832521b4e7785c9643f6a995c92b4a691d)

Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
2026-01-06 16:46:04 +01:00
Miss Islington (bot)
7d52ea8978
[3.14] gh-143394: On macOS, run main PyREPL tests as "Apple Terminal" as well (GH-143461) (GH-143466)
(cherry picked from commit 7dae1077cd18c1ddc50b130335936bc71e1c4ccd)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2026-01-06 15:49:43 +01:00
Semyon Moroz
8b72c3d561
[3.14] gh-143331: Schedule to remove format "N" for Decimal (GH-143372) (#143476)
(cherry picked from commit dd750b348501247d458ea8d454213d4959a8f8b9)
2026-01-06 15:58:29 +02:00
Hugo van Kemenade
6b836ca172
[3.14] Allow Android to fail CI (GH-143471) (GH-143472)
(cherry picked from commit efb4e6c73374f910e9aae9b2431a3718331c3c79)
2026-01-06 13:11:04 +00:00
Stan Ulbrych
9f91278412
[3.14] gh-143003: Fix possible shared buffer overflow in bytearray.extend() (GH-143086) (GH-143447)
When __length_hint__() returns 0 for non-empty iterator, the data can be
written past the shared 0-terminated buffer, corrupting it.
(cherry picked from commit 522563549a49d28e763635c58274a23a6055f041)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-06 13:48:45 +02:00
Miss Islington (bot)
c889ff6ba5
[3.14] gh-143394: filter for turning off automatic margins in test_no_newline (GH-143433) (GH-143459)
(cherry picked from commit 04ace41fe2cf648be433503d0c336b154ad63a3b)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2026-01-05 23:20:51 +01:00
Miss Islington (bot)
dbf08242b5
[3.14] gh-143434: Fix typo in zstd documentation (GH-143437) (#143444)
gh-143434: Fix typo in zstd documentation (GH-143437)
(cherry picked from commit 240a6c326276c01cc7714a91a3e08eb77ddc4bc7)

Co-authored-by: Ritam Pal <ritamjunior26@gmail.com>
2026-01-05 20:01:08 +00:00
Łukasz Langa
98a255699d
[3.14] gh-69605: Check for already imported modules in PyREPL module completion (GH-143438)
Co-authored-by: Loïc Simon <loic.simon@napta.io>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>

Cherry picked from commits 7db209b5647b77e9d665830d522153ed891d2e12 and aed90508b3112aa5294c6d4ff6c2026e3c794129.
2026-01-05 19:47:26 +01:00
Miss Islington (bot)
d0e9f4445a
[3.14] gh-143309: fix test_execve_env_concurrent_mutation_with_fspath_posix buildbot failure (GH-143415) (#143419)
gh-143309: fix `test_execve_env_concurrent_mutation_with_fspath_posix` buildbot failure (GH-143415)
(cherry picked from commit c99f7667436d8978b4077704333e2a351f2a026f)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-01-05 00:11:59 +01:00
Miss Islington (bot)
623dbafc9d
[3.14] gh-143309: fix UAF in os.execve when the environment is concurrently mutated (GH-143314) (#143398)
gh-143309: fix UAF in `os.execve` when the environment is concurrently mutated (GH-143314)
(cherry picked from commit 9609574e7fd36edfaa8b575558a82cc14e65bfbc)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-01-03 22:31:45 +00:00
Miss Islington (bot)
c99d87db1f
[3.14] gh-143308: fix UAF when PickleBuffer is concurrently mutated in a callback (GH-143312) (#143396)
gh-143308: fix UAF when PickleBuffer is concurrently mutated in a callback (GH-143312)
(cherry picked from commit 6c53af18f61c074d514e677b469b6201573a59da)

---------------

Co-authored-by: Aaron Wieczorek <aaronw@fastmail.com>
Co-authored-by: Aaron Wieczorek <woz@Aarons-MacBook-Pro.local>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-01-03 22:27:35 +00:00
Miss Islington (bot)
6eafcaee64
[3.14] gh-136924: Suspend REPL colorizing when in a REPL interactive command (GH-136926) (GH-143390)
(cherry picked from commit 2c39b9d2f2ed8fb719d89f895dba114fb9096826)

Co-authored-by: Olga Matoula <olgamatoula@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2026-01-03 15:34:47 +01:00
Miss Islington (bot)
661083297f
[3.14] gh-140648: Make asyncio REPL respect the -I flag (isolated mode) (GH-143045) (#143383)
gh-140648: Make asyncio REPL respect the `-I` flag (isolated mode) (GH-143045)
(cherry picked from commit e7c542de5f069a4b83e8eded3067613e4d59a529)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2026-01-03 08:29:05 +00:00
Miss Islington (bot)
98bb48e55c
[3.14] gh-76187: Document the c typecode for multiprocessing.Array. (GH-132504) (#143369)
gh-76187: Document the `c` typecode for `multiprocessing.Array`. (GH-132504)

* Document the `c` typecode for `multiprocessing.Array`.

* Add quotes

* Mention that 'w' is not supported
(cherry picked from commit 136f6d835588e0f72cecdff855afc8f424381ed5)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2026-01-02 19:24:06 +00:00
Miss Islington (bot)
675dfe7247
[3.14] gh-138897: Use _pyrepl.pager for _sitebuiltins._Printer (GH-138898) (GH-143364)
(cherry picked from commit 0417dabe3f560470eec63a2485b1741ba9c5e697)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2026-01-02 17:27:09 +01:00
Miss Islington (bot)
80d8a7ef10
[3.14] gh-139262: Prevent swallowing REPL input on Windows (GH-139263) (GH-143362)
(cherry picked from commit ef6f92a2a63fd83d62d9a431b2c3133a9a069ea0)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2026-01-02 16:43:46 +01:00
Miss Islington (bot)
935a366dca
[3.14] gh-143148: Replace pre-commit with prek in CI (GH-143149) (#143360)
Co-authored-by: Johann Christensen <johannchristensen@outlook.de>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2026-01-02 15:25:28 +00:00
Miss Islington (bot)
a141b840af
[3.14] gh-128067: Fix pyrepl overriding printed output without newlines (GH-138732) (GH-143350)
(cherry picked from commit 8a2deea1fc725f8147254f87c6042fcf75a1d03b)

Co-authored-by: Jan-Eric Nitschke <47750513+JanEricNitschke@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2026-01-02 16:12:02 +01:00
Miss Islington (bot)
dc16c7e9a9
[3.14] Update docstrings of typing.Hashable, typing.List, etc., to reflect their deprecation (GH-143295) (#143348)
Update docstrings of `typing.Hashable`, `typing.List`, etc., to reflect their deprecation (GH-143295)
(cherry picked from commit 18f3c59e57e5d30218210136060310310b10ff72)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2026-01-02 11:56:56 +00:00
Miss Islington (bot)
8beec4a2e4
[3.14] gh-143310: fix crash in Tcl object conversion with concurrent mutations (GH-143321) (#143343)
gh-143310: fix crash in Tcl object conversion with concurrent mutations (GH-143321)
(cherry picked from commit 9712dc1d9eb03ffa96ed746d20bd43239d251ba7)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-01-02 10:17:13 +00:00
Miss Islington (bot)
f6f3ddb401
[3.14] gh-143048: Remove outdated mention to curses in the "Interactive Mode" docs (GH-143049) (#143325)
gh-143048: Remove outdated mention to `curses` in the "Interactive Mode" docs (GH-143049)
(cherry picked from commit 2d9f4e357ad30e002ca0c7568047e9a818b96cd3)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2026-01-01 11:57:57 +00:00
Bénédikt Tran
048edac8be
[3.14] gh-142830: prevent some crashes when mutating sqlite3 callbacks (GH-143245) (#143322)
(cherry picked from commit 7f6c16a956d598663d8c67071c492f197045d967)
2026-01-01 11:24:21 +00:00
Miss Islington (bot)
8680b18f26
[3.14] gh-140920: remove incorrect mentions to concurrent.futures.interpreter.ExecutionFailed (GH-141723) (#143315)
gh-140920: remove incorrect mentions to `concurrent.futures.interpreter.ExecutionFailed` (GH-141723)

Remove documentation for inexistant `concurrent.futures.interpreter.ExecutionFailed`
and replace its occurrences by `concurrent.interpreters.ExecutionFailed` since this
is the documented exception.
(cherry picked from commit c5215978ebfea9471f313d5baa70a4e68bfb798b)

Co-authored-by: Lakshya Upadhyaya <lakshya.upadhyaya05@gmail.com>
2025-12-31 20:51:31 +00:00
Miss Islington (bot)
38f23604c1
[3.14] gh-115634: document ProcessPoolExecutor max_tasks_per_child bug (GH-140897) (#143302)
gh-115634: document ProcessPoolExecutor max_tasks_per_child bug (GH-140897)
(cherry picked from commit 04899b8539ab83657a4495203f26b3cb1a6f46dc)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-12-30 23:29:56 +00:00
Miss Islington (bot)
acd2846b9b
[3.14] gh-130167: Add a What's New entry for changes to `textwrap.{de,in}dent` (GH-131924) (#143292)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.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-12-30 13:03:03 +00:00
Miss Islington (bot)
d951905ec9
[3.14] gh-143284: Temporarily install Sphinx<9 to fix Chinese search (GH-143286) (#143290)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-12-30 12:39:28 +00:00
Miss Islington (bot)
ed73d4f281
[3.14] gh-69686: Remove untrue part of __import__ replacement docs (GH-143261) (#143281)
gh-69686: Remove untrue part of `__import__` replacement docs (GH-143261)

Remove untrue part of `__import__` replacement docs

The original statement effectively says that replacing `__import__` at global scope affects import statements, and not only that, but only import statements within the rest of the executing module. None of that has been true since at least Python 2.7, I think.

This was likely missed in python/cpython#69686.
(cherry picked from commit 79c03ac0015ccf1cbb759f870e2af9d68f60fe3a)

Co-authored-by: Thanos <111999343+Sachaa-Thanasius@users.noreply.github.com>
2025-12-30 05:22:38 +00:00