Commit graph

125437 commits

Author SHA1 Message Date
sobolevn
aa5ad50597
[3.13] gh-143635: Fix crash in ga_repr_items_list (GH-143670) (#143852)
(cherry picked from commit bdba5f0db2)
2026-01-15 15:27:31 +00:00
Serhiy Storchaka
149ecbb9a9
[3.13] gh-142829: Fix use-after-free in Context.__eq__ via re-entrant ContextVar.set (GH-142905) (GH-143871)
(cherry picked from commit a4086d7f89)

Co-authored-by: A.Ibrahim <abdulrasheedibrahim47@gmail.com>
2026-01-15 15:00:44 +00:00
Miss Islington (bot)
343b5c4421
[3.13] gh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCAL_SYMBOL,Py_IMPORTED_SYMBOL) (GH-143508) (GH-143787)
(cherry picked from commit a7ba3b124f)

Co-authored-by: Yashraj <yashrajpala8@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-15 13:34:37 +01:00
Serhiy Storchaka
eb6dbd7fec
[3.13] Add regression test for add() after remove() with hash collision in set (GH-143781) (GH-143859)
(cherry picked from commit 565685f6e8)
2026-01-15 10:04:34 +00:00
Miss Islington (bot)
2516dd0d06
[3.13] gh-143834: Fix PyLong_AsNativeBytes docs for negative number padding (GH-143840) (GH-143855)
(cherry picked from commit 421bd1770a)

Co-authored-by: Muneeb Ullah <moneebullah25@gmail.com>
2026-01-15 09:34:21 +01:00
Serhiy Storchaka
5c028df404
[3.13] gh-141805: Fix crash after concurrent addition objects with the same hash to set (GH-143815) (GH-143853)
This happens when the set contained several elements with the same hash,
and then some of them were removed.
(cherry picked from commit b8e925b4f8)
2026-01-15 07:59:15 +00:00
Miss Islington (bot)
8c6d87693b
[3.13] gh-106287: Do not write objects after an unmarshalling error (GH-132715) (GH-143833)
Writing out an object may involve a slot lookup, which is not safe to do with
an exception raised. In debug mode an assertion failure will occur if this
happens.
(cherry picked from commit ce8f5f98c6)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
2026-01-14 11:48:52 +00:00
Miss Islington (bot)
5f7a49a77b
[3.13] gh-141004: Document old provisional names for vectorcall/code API (GH-143568) (GH-143829)
For vectorcall API, the underscore-prefixed provisional names
continue to be available per PEP 590:
https://peps.python.org/pep-0590/#finalizing-the-api
Use `versionadded`, `versionchanged`, and `:no-typesetting:`
to mark this up.

For PyCode API, use `:no-typesetting:` rather than `index::` so that
these are semantically documented as C functions.
(cherry picked from commit 7e8a1b5061)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-01-14 11:01:54 +01:00
Miss Islington (bot)
7760775375
[3.13] gh-137113 docs: note readline no longer supported in REPL after 3.13 (GH-137142) (GH-143792)
Add a note to the readline module documentation stating that
Python 3.13 and later no longer supports readline in the default REPL,
as per gh-118840. Includes workaround using PYTHON_BASIC_REPL.

Update tutorial to remove the reference, and use a different key to
test things out.
(cherry picked from commit 971f387bbb)

Signed-off-by: Kuang Yu Heng <yuheng3107@gmail.com>
Co-authored-by: Kuang Yu Heng <yuheng3107@gmail.com>
2026-01-14 10:56:18 +01:00
Gregory P. Smith
480f48035b
[3.13] gh-143706: Fix sys.argv not set during multiprocessing forkserver __main__ preload (GH-143717) (#143821)
The forkserver was not passing sys.argv to its main() function, causing
sys.argv to be empty during `__main__` module import in child processes. This
fixes a non-obvious regression inadvertently introduced by the gh-126631 main
preloading fix.

(cherry picked from commit 298d5440eb)
2026-01-13 18:09:05 -08:00
Hugo van Kemenade
b6c6c47693
[3.13] Bump GitHub Actions (GH-143757) (#143798) 2026-01-13 18:47:03 +02:00
Miss Islington (bot)
3dd9afcf91
[3.13] gh-143728: Keep TypedDict and NamedTuple in class role in docs (GH-143702) (#143800)
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2026-01-13 13:58:14 +00:00
Miss Islington (bot)
be602fcde6
[3.13] gh-143249: Fix buffer leak when overlapped operation fails to start on windows (GH-143250) (#143796)
gh-143249: Fix buffer leak when overlapped operation fails to start on windows (GH-143250)
(cherry picked from commit 103a384bfd)

Co-authored-by: Yongtao Huang <yongtaoh2022@gmail.com>
2026-01-13 13:53:41 +00:00
Miss Islington (bot)
0770c78131
[3.13] gh-141004: Don't trigger run-tests when Tools/check-c-api-docs/ignored_c_api.txt is changed (GH-143583) (GH-143794)
gh-141004: Don't trigger `run-tests` when `Tools/check-c-api-docs/ignored_c_api.txt` is changed (GH-143583)
(cherry picked from commit 1176facbf2)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-01-13 13:48:39 +00:00
Miss Islington (bot)
cbf08d5a62
[3.13] gh-106318: Add examples for str.replace() method (GH-143581) (GH-143788)
(cherry picked from commit af9f783a7e)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2026-01-13 12:23:26 +00:00
Inada Naoki
b739bd1d42
[3.13] gh-143189: fix insertdict() for non-Unicode key (GH-143285) (#143772) 2026-01-13 10:12:38 +00:00
Terry Jan Reedy
92d80c6067
[3.13] gh-139707: Copy-strip change to idle.rst into idlelib (#143767)
Copy net new text in idle.rst from main to 3.13.
Make 3.13 docs and copy-strip idle.html to idlelib/help.html.
See https://github.com/python/cpython/issues/139707#issuecomment-3737374788
and PR #143718 message for more.

* Revert url to 'main' from '3.13'

The branch in the source links in the revised help.html
become '3.13' instead of 'main' because the html
was generated from an edited 3.13 version of idle.rst
instead being backported from main.  This reversion
avoids the possibility of future backport merge conflicts.

The version makes no difference to the Help/IDLE doc display as
the url is currently neither displayed nor linked to the link title
-- 'Lib/idlelib'.  If we do make the links live, we can use
sys.version_info to replace 'main' when main is no longer the source branch.
2026-01-12 22:58:30 -05:00
Miss Islington (bot)
5616ef9276
[3.13] gh-143762 Backport a6bc60d for random combinatoric recipes (GH-143764) (gh-143766) 2026-01-13 00:25:55 +00:00
Miss Islington (bot)
0612f5b882
[3.13] gh-142461: Move misplaced NEWS entries to an appropriate section (GH-143411) (GH-143745)
(cherry picked from commit 3d44f0ab65)

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
2026-01-12 18:20:22 +00:00
Stan Ulbrych
8a09b511a0
[3.13] gh-141536: Fix a crash when running test_capi *after* test_code in the same process (GH-141537) (GH-143625)
(cherry picked from commit b2827de18f)

Co-authored-by: T. Wouters <thomas@python.org>
2026-01-12 20:07:34 +02:00
Shamil
ab8224697a
[3.13] gh-140306: Clear uncaught exception info after applying error in subinterpreter (GH-140397) 2026-01-12 18:19:57 +02:00
Miss Islington (bot)
8b7ebbb432
[3.13] gh-143544: Fix possible use-after-free in the JSON decoder when JSONDecodeError disappears during raising it (GH-143561) (#143734)
gh-143544: Fix possible use-after-free in the JSON decoder when JSONDecodeError disappears during raising it (GH-143561)
(cherry picked from commit c315748060)

Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-01-12 16:02:23 +00:00
Petr Viktorin
b06ef5b59a
[3.13] gh-141004: Improve make check-c-api-docs (GH-143564) (GH-143594)
- Gather all documented names into a set in a single pass.
  This makes the check much faster.

- Do not match substrings (e.g. documenting `PyErr_WarnEx`
  doesn't mean that `PyErr_Warn` is documented)

- Consider `PY`-prefixed names (a lot of old macros use this)

(cherry picked from commit 234a15dc4e)
2026-01-12 14:05:31 +01:00
Sergey B Kirpichev
8fd4435cd9
[3.13] gh-78724: Raise RuntimeError's when calling methods on non-ready Struct()'s (GH-143643) (GH-143714)
(cherry picked from commit 515ae4078d)
2026-01-12 14:45:52 +02:00
Serhiy Storchaka
1822f59dc7
[3.13] gh-142881: Fix concurrent and reentrant call of atexit.unregister() (GH-142901) (GH-143722)
(cherry picked from commit dbd10a6c29)
2026-01-12 10:05:09 +00:00
Miss Islington (bot)
8ec108378c
[3.13] gh-143346: Fix calculation of the line width for wrapped Base64 in plistlib (GH-143347) (GH-143720)
It was incorrect in case of mixed tabs and spaces in indentation.
(cherry picked from commit 5f28aa2f37)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-12 09:04:00 +00:00
Serhiy Storchaka
dcc6117628
[3.13] gh-143378: Fix use-after-free when BytesIO is concurrently mutated during write operations (GH-143408) (GH-143600)
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 6d54b6ac7d)

Co-authored-by: zhong <60600792+superboy-zjc@users.noreply.github.com>
2026-01-12 10:37:28 +02:00
Miss Islington (bot)
ea1ecf6504
[3.13] gh-127750: Fix annotations in singledispatchmethod signature tests (GH-143571) (GH-143708)
These tests relied on a bug -- gh-84644, which is that singledispatch
doesn't verify the annotation is on the "first" parameter.
(cherry picked from commit 620a5b9269)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2026-01-11 19:47:05 +00:00
Miss Islington (bot)
18eeec4bea
[3.13] gh-142972: Document arbitrary ordering in Path.glob and Path.rglob (GH-143025) (GH-143710)
gh-142972: Document arbitrary ordering in `Path.glob` and `Path.rglob` (GH-143025)
(cherry picked from commit 9d13ca97c1)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2026-01-11 19:42:44 +00:00
Miss Islington (bot)
cf5b31c31a
[3.13] gh-143420: Clarify sequence behavior for slice indexes (GH-143422) (#143703)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2026-01-11 17:23:52 +00:00
Miss Islington (bot)
0dc3c08950
[3.13] gh-86139: Correct NamedTuple and TypedDict's type in typing.rst (GH-143692) (#143697)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2026-01-11 15:59:19 +00:00
Serhiy Storchaka
e319262c4e
[3.13] gh-143638: Forbid cuncurrent use of the Pickler and Unpickler objects in C implementation (GH-143664) (GH-143687)
Previously, this could cause crash or data corruption, now concurrent calls
of methods of the same object raise RuntimeError.
(cherry picked from commit d1282efb2b)
2026-01-11 12:34:36 +00:00
Miss Islington (bot)
b2a2dcda3a
[3.13] Remove outdated comment about excess_args warning in object.__init__ (GH-143669) (#143681)
Remove outdated comment about `excess_args` warning in `object.__init__` (GH-143669)

The code emitting a warning was removed in 96384b93aa.
(cherry picked from commit 03e6457096)

Co-authored-by: Manuel Jacob <me@manueljacob.de>
2026-01-11 07:49:37 +00:00
Miss Islington (bot)
3aa233e401
[3.13] Sync the batched() example with the grouper() example. (gh-143676) (gh-143679) 2026-01-10 23:06:57 -06:00
Bénédikt Tran
733a5cf51c
[3.13] gh-143377: fix crashes in _interpreters.capture_exception (GH-143418) (#143653)
(cherry picked from commit ce6bae92da)
2026-01-10 13:59:14 +00:00
Miss Islington (bot)
523d866205
[3.13] Doc: remove duplicate GitHub issue reference in "What's New in Python 3.13" (GH-143654) (#143657)
Doc: remove duplicate GitHub issue reference in "What's New in Python 3.13" (GH-143654)
(cherry picked from commit aa8578dc54)

Co-authored-by: emmanuel <emmanuel20232035@gmail.com>
2026-01-10 13:40:34 +00:00
Miss Islington (bot)
7c99a42d10
[3.13] gh-143641: Make ready_to_import always remove tempdir from sys.path (GH-143642) (#143648)
gh-143641: Make `ready_to_import` always remove tempdir from `sys.path` (GH-143642)

Make ready_to_import always remove tempdir from sys.path
(cherry picked from commit e7f5ffa0de)

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2026-01-10 10:14:46 +00:00
Miss Islington (bot)
d12d7a9c09
[3.13] gh-72239: Add note distinguishing concurrent.futures.Future from asyncio.Future (GH-143288) (#143608)
gh-72239: Add note distinguishing concurrent.futures.Future from asyncio.Future (GH-143288)
(cherry picked from commit a9ca49d9c6)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2026-01-10 12:22:18 +05:30
Serhiy Storchaka
618a42410f
[3.13] gh-143006: Fix and optimize mixed comparison of float and int (GH-143084) (GH-143624)
When comparing negative non-integer float and int with the same number
of bits in the integer part, __neg__() in the int subclass returning
not an int caused an assertion error.

Now the integer is no longer negated. Also, reduced the number of
temporary created Python objects.
(cherry picked from commit 66bca383bd)
2026-01-09 17:43:35 +00:00
Miss Islington (bot)
57c56b0fb1
[3.13] gh-143547: Fix PyErr_FormatUnraisable() fallback (GH-143557) (GH-143603) (#143612)
[3.14] gh-143547: Fix PyErr_FormatUnraisable() fallback (GH-143557) (GH-143603)

gh-143547: Fix PyErr_FormatUnraisable() fallback (GH-143557)

Hold a strong reference to 'hook' while calling the default
unraisable took to log hook failure.
(cherry picked from commit 1d0baf1ae4)


(cherry picked from commit 39a2bcf949)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-09 15:33:25 +00:00
Miss Islington (bot)
76184823d1
[3.13] gh-106318: Add examples for str.rfind() method (GH-143582) (#143617)
gh-106318: Add examples for str.rfind() method (GH-143582)
(cherry picked from commit c696f33d9e)

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

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

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2026-01-09 15:29:04 +00:00
Sam Gross
a4a33ff71d
[3.13] gh-142095: Use thread local frame info in py-bt and py-bt-full when available (gh-143371) (#143567)
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 49c3b0a67a)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-08 12:35:56 -05:00
Miss Islington (bot)
cb42565839
[3.13] gh-143553: Add support for parametrized resources in regrtests (GH-143554) (GH-143556)
For example, "-u xpickle=2.7" will run test_xpickle only against Python 2.7.
(cherry picked from commit c07e5ec0a9)

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

Co-authored-by: Alex Willmer <alex@moreati.org.uk>
2026-01-08 13:46:33 +00:00
Miss Islington (bot)
cf0f4e6ebc
[3.13] gh-143528: Fix test_time.test_thread_time() (GH-143558) (#143560)
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 efaa56f73c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-08 13:29:41 +00:00
Miss Islington (bot)
5af09f500b
[3.13] gh-143089: Fix ParamSpec default examples to use list instead of tuple (GH-143179) (#143539)
Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
2026-01-08 11:49:43 +00:00
Miss Islington (bot)
e1572eadd0
[3.13] Fix a typo in STORE_SLICE docs (GH-143500) (#143534)
Fix a typo in STORE_SLICE docs (GH-143500)
(cherry picked from commit 228d95582e)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2026-01-07 22:42:48 +00:00
Łukasz Langa
ad99027e5c
[3.13] gh-138568: Make help mode in PyREPL not exit on empty line input (GH-143512) (GH-143520)
(cherry picked from commit b3e4a3462f)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong0618 <zouzou0208@gmail.com>
2026-01-07 18:44:39 +01:00
Miss Islington (bot)
1de1d3d6d7
[3.13] gh-106318: Add examples for str.casefold() and str.lower() methods (GH-142154) (#143525)
gh-106318: Add examples for str.casefold() and str.lower() methods (GH-142154)
(cherry picked from commit 51a56a3a7b)

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:24 +01:00