See #123597. The typo in Icon/README.txt was fixed
in the unmerged 3.13 backport #123608 of the
PR that added the text with the typo.
(cherry picked from commit 1f4a49e)
Co-authored-by: abstractee
gh-112938: IDLE - Fix uninteruptable hang when Shell gets rapid continuous output. (GH-124310)
https://github.com/python/cpython/issues/88496 replaced text.update with text.update_idletasks in colorizer.py and outwin.py to fix test failures on macOS. While theoretically correct, the result was Shell freezing when receiving continuous short strings to print. Test: `while 1: 1`.
The guess is that there is no idle time in which to do the screen update. Reverting the change in one of the files,
outwin, fixes the issue. Colorizer runs ever 1/20 second and seems to work fine.
When running test-outwin on macOS, alias 'update'
to 'update_idletasks on the text used for testing.
(cherry picked from commit d5f95ec07b)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-90190: Add doc for using `singledispatch` with precise collection type hints (GH-116544)
(cherry picked from commit 2357d5ba48)
Co-authored-by: Matt Delengowski <matt.delengowski@gmail.com>
gh-124520: What's New entry for ctypes metaclass __new__/__init__ change (GH-124546)
(cherry picked from commit 3387f76b8f)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-124487: Update Windows API version to Windows 8.1 (GH-124676)
(cherry picked from commit a4916e6013)
Co-authored-by: Steve Dower <steve.dower@python.org>
gh-124609: Fix _Py_ThreadId for Windows builds using MinGW (GH-124663)
(cherry picked from commit 0881e2d3b1)
Co-authored-by: Tony Roberts <tony@pyxll.com>
* GH-65961: Document the deprecation of `__package__` and `__cached__` (GH-124377)
The code changes for warning related to `__package__` landed in Python 3.12. `__cached__` doesn't have any changes as it isn't used but only set by the import system.
(cherry picked from commit 67201ad53f)
---------
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Barry Warsaw <barry@python.org>
gh-124628: Pyrepl inputs on Windows shouldn't always be blocking reads (GH-124629)
(cherry picked from commit 83e5dc0f4d)
Co-authored-by: Dino Viehland <dinoviehland@meta.com>
gh-119004: fix a crash in equality testing between `OrderedDict` (GH-121329)
(cherry picked from commit 38a887dc3e)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-124682: Disable test that is prone to intermittent failure on iOS. (GH-124683)
Disable test that is prone to intermittent failure on iOS.
(cherry picked from commit 10d504aecc)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Docs: Update and proofread `library/venv.rst` (GH-124121)
(cherry picked from commit 23e812b84a)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-116510: Fix crash due to shared immortal interned strings. (gh-124646)
(cherry picked from commit 98b2ed7e23)
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
gh-116510: Fix crash during sub-interpreter shutdown (gh-124645)
Fix a bug that can cause a crash when sub-interpreters use "basic"
single-phase extension modules. Shared objects could refer to PyGC_Head
nodes that had been freed as part of interpreter shutdown.
(cherry picked from commit 6f9525dd3f)
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
Docs: for for/else clarify that return or raise also skip the else (GH-124591)
(cherry picked from commit 5329d1b74a)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
GH-95079: document error behaviour for some unicode C APIs (GH-95080)
(cherry picked from commit b79a21ea42)
Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
gh-123017: Add Android to the list of platforms where `strftime` doesn't support negative years (GH-124467)
Add Android to the list of platforms where `strftime` doesn't support negative years
(cherry picked from commit 0a3577bdfc)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Closes GH-123242. The real criterion is that the attribute does not
exist on heap types, but I don't think we should discuss heap vs.
static types in the language reference.
(cherry picked from commit 99b23c64de)
gh-101100: Make __subclasses__ doctest stable (GH-124577)
Using a standard library class makes this test difficult to maintain
as other tests and other parts of the stdlib may create subclasses,
which may still be alive when this test runs depending on GC timing.
(cherry picked from commit 08a467b537)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
gh-115528: Update language reference for PEP 646 (GH-121181)
To recap: the objective is to make starred expressions valid in `subscription`,
which is used for generics: `Generic[...]`, `list[...]`, etc.
What _is_ gramatically valid in such contexts? Seemingly any of the following.
(At least, none of the following throw `SyntaxError` in a 3.12.3 REPL.)
Generic[x]
Generic[*x]
Generic[*x, y]
Generic[y, *x]
Generic[x := 1]
Generic[x := 1, y := 2]
So introducting
flexible_expression: expression | assignment_expression | starred_item
end then switching `subscription` to use `flexible_expression` sorts that.
But then we need to field `yield` - for which any of the following are
apparently valid:
yield x
yield x,
yield x, y
yield *x,
yield *x, *y
Introducing a separate `yield_list` is the simplest way I've been figure out to
do this - separating out the special case of `starred_item ,`.
(cherry picked from commit 7d3497f617)
Co-authored-by: Matthew Rahtz <matthew.rahtz@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Programming FAQ: Mention object.__setattr__ as a technique for delegation (GH-124617)
This is used for example by threading.local in the stdlib.
(cherry picked from commit 43979fad90)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Doc: Use the short version for daily downloads (GH-124602)
(cherry picked from commit 2c472d36b7)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-123560: Correct docs for "empty" format type for floats (GH-123561)
(cherry picked from commit 274d9ab619)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
gh-124538: Fix crash when using `gc.get_referents` on an untracked capsule object (GH-124559)
(cherry picked from commit f923605658)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
gh-124402: Speed up test_free_threading and test_super (#124491)
* Reduce the number of iterations and the number of threads so a
whole test file takes less than a minute.
* Refactor test_racing_iter_extend() to remove two levels of
indentation.
* test_monitoring() uses a sleep of 100 ms instead of 1 second.
(cherry picked from commit 0387c34f7c)
gh-123856: Fix PyREPL failure when a keyboard interrupt is triggered after using a history search (GH-124396)
(cherry picked from commit c1600c78e4)
Co-authored-by: Emily Morehouse <emily@cuttlesoft.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Doc: Use ``major.minor`` for documentation distribution archive filenames (GH-124489)
(cherry picked from commit 6318ffcba2)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-123445: calendar: Improve descriptions for day and month attributes (GH-123483)
(cherry picked from commit 8447c933da)
Co-authored-by: Mat S <mscull@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Doc: Improve documentation for the ``path`` argument in ``shutil.which()`` (GH-124494)
(cherry picked from commit 0d38409f42)
Co-authored-by: Tom Most <twm@freecog.net>
Adjust build_ubuntu_ssltests job to use cache for the correct OS version (GH-124403)
(cherry picked from commit 54dd77fb8c)
Co-authored-by: Zachary Ware <zach@python.org>
For-else deserves its own section in the tutorial (GH-123946)
* For-else deserves its own section in the tutorial
* remove mention of unrolling the loop
* Update Doc/tutorial/controlflow.rst
---------
(cherry picked from commit ffdc80e93d)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
gh-124402: Require cpu resource in test_super slow method (GH-124434)
test___class___modification_multithreaded() now requires the 'cpu'
test resource on a Free Threaded build.
(cherry picked from commit 5a60566074)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-65169: Clarify prog default in argparse (GH-31602)
(cherry picked from commit e69ff34e81)
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
gh-124402: Require cpu resource in test_free_threading (#124438)
Require the 'cpu' test resource on slow test_free_threading tests.
(cherry picked from commit 38a5beb12a)
* Further revise idlelib/Icons/README.text (GH-123364)
In particular, add trademark derivative approval information.
(cherry picked from commit fe85a8291d)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* Update Lib/idlelib/Icons/README.txt
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-123789: `secrets.randbits` returns only non-negative int (GH-123801)
(cherry picked from commit beee91cdcc)
Co-authored-by: Wulian <1055917385@qq.com>
gh-123834: Add `symtable` to the list of modules with a CLI (GH-123835)
(cherry picked from commit 32bc2d6141)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-123905: Update TOML description to include version number (GH-123906)
Update TOML description to include version number
There is some movement, currently blocked, that would update the TOML spec to 1.1.0; this would include breaking changes to what characters are allowed. Thus, it is worthwhile for the library page to be clear which version is implemented here.
(cherry picked from commit 1b29f4144c)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Paul Hoffman <phoffman@proper.com>
gh-108951: Document how to terminate an asyncio.TaskGroup (GH-123837)
We don't want to add another API, since the recipe is straightforward and rarely needed.
The advantage is that we could backport this to the earliest Python version that has taskgroups (3.11, alas in security mode already, so we'll just do 3.12 and 3.13).
(cherry picked from commit ef05801ba0)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>