Commit Graph

123108 Commits

Author SHA1 Message Date
Miss Islington (bot) dbfc37a5f8
[3.13] gh-123797: Check for runtime availability of `ptsname_r` on macos (GH-123806) (#124270)
gh-123797: Check for runtime availability of `ptsname_r` on macos (GH-123806)
(cherry picked from commit 3e36e5aef1)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-09-29 18:06:53 -07:00
Miss Islington (bot) dddae6647e
[3.13] gh-124248: Fix crash in struct when processing 0p fields (GH-124251) (#124277)
gh-124248: Fix crash in struct when processing 0p fields (GH-124251)
(cherry picked from commit 63f196090f)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2024-09-29 18:06:32 -07:00
Miss Islington (bot) 7f101dcfeb
[3.13] gh-124254: Detect freethreaded MSI component when doing an upgrade on Windows (GH-124279) (#124347)
gh-124254: Detect freethreaded MSI component when doing an upgrade on Windows (GH-124279)
(cherry picked from commit df7228ce14)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-09-29 18:06:11 -07:00
Miss Islington (bot) 8d3a0fecbe
[3.13] GH-87041: Fix incorrect indentation in argparse help (GH-124230) (#124373)
GH-87041: Fix incorrect indentation in argparse help (GH-124230)

In case of usage a long command along with max_help_position more than
the length of the command, the command's help was incorrectly started
on the new line.

(cherry picked from commit 7ee9921734)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
Co-authored-by: Pavel Ditenbir <pavel.ditenbir@gmail.com>
2024-09-29 18:05:51 -07:00
Alex Waygood 67aa68f1b4
[3.13] Bump Ruff to 0.6.7 (#124384) (#124389)
Bump Ruff to 0.6.7 (#124384)
2024-09-29 18:04:56 -07:00
Miss Islington (bot) 6425443e1d
[3.13] bpo-44864: Do not translate user-provided strings in ArgumentParser.add_subparsers() (GH-27667) (#124506)
bpo-44864: Do not translate user-provided strings in ArgumentParser.add_subparsers() (GH-27667)

Call _() on literal strings only.
(cherry picked from commit d3c76dff44)

Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
2024-09-29 18:03:29 -07:00
Miss Islington (bot) 0a57fe3a7d
[3.13] gh-116622: Make test_unzip_zipfile recognize Android error message format (GH-124462) (#124516)
gh-116622: Make test_unzip_zipfile recognize Android error message format (GH-124462)

Make test_unzip_zipfile recognize Android error message format
(cherry picked from commit 461c12b438)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2024-09-29 18:03:12 -07:00
Miss Islington (bot) 62f691f3d1
[3.13] gh-124513: Check args in framelocalsproxy_new() (GH-124515) (#124539)
gh-124513: Check args in framelocalsproxy_new() (GH-124515)

Fix a crash in FrameLocalsProxy constructor: check the number of
arguments.
(cherry picked from commit d6954b6421)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-09-29 18:03:00 -07:00
Miss Islington (bot) c7f9332ee5
[3.13] gh-124378: Update test_ttk for Tcl/Tk 8.6.15 (GH-124542) (#124544)
gh-124378: Update test_ttk for Tcl/Tk 8.6.15 (GH-124542)
(cherry picked from commit fb6bd31cb7)

Co-authored-by: Zachary Ware <zach@python.org>
Co-authored-by: Marc Culler <culler@users.noreply.github.com>
2024-09-29 18:02:42 -07:00
Miss Islington (bot) e20505cb41
[3.13] gh-124498: Fix `TypeAliasType` not to be generic, when `type_params=()` (GH-124499) (#124603)
gh-124498: Fix `TypeAliasType` not to be generic, when `type_params=()` (GH-124499)
(cherry picked from commit abe5f799e6)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-09-29 18:01:06 -07:00
Bénédikt Tran 6b847be207
[3.13] gh-89683: add tests for `deepcopy` on frozen dataclasses (GH-123098) (#124678)
* gh-89683: add tests for `deepcopy` on frozen dataclasses (gh-123098)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2024-09-29 18:00:42 -07:00
Miss Islington (bot) e8980b17bb
[3.13] gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386) (#124719)
gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386)
(cherry picked from commit 425587a110)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-09-29 17:59:54 -07:00
Miss Islington (bot) f8e3de8c7d
[3.13] docs: improve venv docs (GH-124540) (#124727)
docs: improve venv docs (GH-124540)

- Move "versionchanged" notes that apply to the whole class to the
  end of the class docs
- Remove or move notes next to the method list that apply to individual
  methods.
- Mark up parameters using the appropriate syntax
- Do not capitalize "boolean"
- Shorten some text
(cherry picked from commit c976d789a9)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-09-29 17:58:32 -07:00
Irit Katriel cebc6f51ee
[3.13] gh-124746: remove assertion on exits having line numbers (#124762)
gh-124746: remove assertion in 3.13
2024-09-29 17:53:47 -07:00
Miss Islington (bot) e532760f46
[3.13] Docs: improve generic `typing.NamedTuple` example (GH-124739) (#124764)
Docs: improve generic `typing.NamedTuple` example (GH-124739)
(cherry picked from commit 76fbee642e)

Co-authored-by: CBerJun <121291537+CBerJun@users.noreply.github.com>
2024-09-29 17:53:13 -07:00
Miss Islington (bot) 7c7e01c2a1
[3.13] gh-124720: Update "Using Python on a Mac" document (GH-124721) (#124775)
gh-124720: Update "Using Python on a Mac" document (GH-124721)

Update "Using Python on a Mac" section of the "Python Setup and Usage"
document and include information on installing free-threading support.
(cherry picked from commit 4b83c03ce9)

Co-authored-by: Ned Deily <nad@python.org>
2024-09-29 17:52:31 -07:00
Miss Islington (bot) 80de9766f7
[3.13] GH-124547: Clear instance dictionary if memory error occurs during object dealloc (GH-124627) (#124714)
GH-124547: Clear instance dictionary if memory error occurs during object dealloc (GH-124627)
(cherry picked from commit 0e21cc6cf8)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2024-09-27 15:23:39 -07:00
Emily Morehouse 0a125d9029
[3.13] gh-81263: Add assignment expressions to `help` (GH-124641) (#124713)
gh-81263: Add assignment expressions to `help` (#124641)

* Add assignment expression (:=) to `help`

* Update index for Assignment Expressions to include pair of `assignment; expression`
2024-09-27 15:21:58 -07:00
Miss Islington (bot) 5c5f02753a
[3.13] doc: PyUnicode_AsUTF8String() fails if string contains surrogates (GH-124605) (#124707)
doc: PyUnicode_AsUTF8String() fails if string contains surrogates (GH-124605)
(cherry picked from commit d8cf587dc7)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-09-27 15:20:44 -07:00
Miss Islington (bot) 4a58bdb49e
[3.13] gh-120104: IDLE: Fix padding in config and search dialogs (GH-120107) (#122740)
gh-120104: IDLE: Fix padding in config and search dialogs (GH-120107)
(cherry picked from commit 4b66b6b7d6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-27 15:19:56 -07:00
Terry Jan Reedy 2df77c8daf
[3.13] Backport idlelib typos (#124325)
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
2024-09-27 15:19:44 -07:00
Miss Islington (bot) 845e039999
[3.13] gh-112938: IDLE - Fix uninteruptable hang when Shell gets rapid continuous output. (GH-124310) (#124318)
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>
2024-09-27 15:19:28 -07:00
Miss Islington (bot) 2b74cce521
[3.13] gh-90190: Add doc for using `singledispatch` with precise collection type hints (GH-116544) (#124710)
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>
2024-09-27 21:28:30 +00:00
Miss Islington (bot) ec4d7b5d22
[3.13] gh-124520: What's New entry for ctypes metaclass __new__/__init__ change (GH-124546) (#124708)
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>
2024-09-27 14:23:16 -07:00
Miss Islington (bot) 09aecb66df
[3.13] gh-124487: Update Windows API version to Windows 8.1 (GH-124676) (#124702)
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>
2024-09-27 19:59:26 +00:00
Miss Islington (bot) 4618c0e5e6
[3.13] gh-124609: Fix _Py_ThreadId for Windows builds using MinGW (GH-124663) (#124698)
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>
2024-09-27 19:58:36 +00:00
Miss Islington (bot) cf98f39103
[3.13] GH-65961: Document the deprecation of `__package__` and `__cached__` (GH-124377) (#124380)
* 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>
2024-09-27 18:53:35 +00:00
Miss Islington (bot) 862ec8bd51
[3.13] gh-124628: Pyrepl inputs on Windows shouldn't always be blocking reads (GH-124629) (#124638)
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>
2024-09-27 11:45:06 -07:00
Miss Islington (bot) c6c3d970ba
[3.13] gh-119004: fix a crash in equality testing between `OrderedDict` (GH-121329) (#124507)
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>
2024-09-27 11:34:48 -07:00
Miss Islington (bot) dff48e1804
[3.13] gh-124682: Disable test that is prone to intermittent failure on iOS. (GH-124683) (#124687)
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>
2024-09-27 18:28:02 +00:00
Miss Islington (bot) 4c97ed4682
[3.13] Docs: Update and proofread `library/venv.rst` (GH-124121) (#124644)
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>
2024-09-27 11:16:02 -07:00
Miss Islington (bot) dc09a0c67f
[3.13] gh-116510: Fix crash due to shared immortal interned strings. (gh-124646) (#124648)
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>
2024-09-27 11:15:25 -07:00
Miss Islington (bot) 1cd2b97113
[3.13] gh-116510: Fix crash during sub-interpreter shutdown (gh-124645) (#124649)
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>
2024-09-27 11:11:02 -07:00
Miss Islington (bot) caaf939fe2
[3.13] gh-86673: Harden `test_ttk.test_element_create_image` (GH-123335) (#124654)
gh-86673: Harden `test_ttk.test_element_create_image` (GH-123335)
(cherry picked from commit 08e1bbe4a3)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-27 11:09:15 -07:00
Miss Islington (bot) ac3e6f801b
[3.13] Docs: for for/else clarify that return or raise also skip the else (GH-124591) (#124659)
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>
2024-09-27 11:08:56 -07:00
Miss Islington (bot) f6e23bb6bb
[3.13] GH-95079: document error behaviour for some unicode C APIs (GH-95080) (#124661)
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>
2024-09-27 11:01:03 -07:00
Miss Islington (bot) 8169d2971f
[3.13] gh-123017: Add Android to the list of platforms where `strftime` doesn't support negative years (GH-124467) (#124674)
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>
2024-09-27 11:00:49 -07:00
Alex Waygood 0c6ddadbc4
[3.13] Fixup indentation for docs on `ModuleSpec` attributes (#124681) (#124685)
Fixup indentation for docs on `ModuleSpec` attributes (#124681)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-09-27 17:59:52 +00:00
Jelle Zijlstra b27e2273be
[3.13] gh-123242: Note that type.__annotations__ may not exist (GH-124557) (#124569)
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)
2024-09-26 16:57:50 -07:00
Miss Islington (bot) a0799223ae
[3.13] gh-101100: Make __subclasses__ doctest stable (GH-124577) (#124579)
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>
2024-09-26 13:56:06 -07:00
Miss Islington (bot) 410e0efc54
[3.13] gh-115528: Update language reference for PEP 646 (GH-121181) (#124632)
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>
2024-09-26 13:55:32 -07:00
Miss Islington (bot) ce63ea0fe4
[3.13] Programming FAQ: Mention object.__setattr__ as a technique for delegation (GH-124617) (#124624)
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>
2024-09-26 13:55:08 -07:00
Miss Islington (bot) 2e7c58a77d
[3.13] Doc: Use the short version for daily downloads (GH-124602) (#124610)
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>
2024-09-26 13:54:52 -07:00
Miss Islington (bot) c74679bff7
[3.13] gh-118181: Fix parameter markup in AST docs (GH-124473) (#124600)
gh-118181: Fix parameter markup in AST docs (GH-124473)
(cherry picked from commit 09aebb1fbc)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2024-09-26 13:52:37 -07:00
Miss Islington (bot) c2aaf50780
[3.13] gh-123560: Correct docs for "empty" format type for floats (GH-123561) (#124596)
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>
2024-09-26 13:52:18 -07:00
Miss Islington (bot) 22dee7b695
[3.13] gh-124538: Fix crash when using `gc.get_referents` on an untracked capsule object (GH-124559) (#124588)
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>
2024-09-26 13:51:58 -07:00
Victor Stinner 632844694e
[3.13] gh-124402: Speed up test_free_threading and test_super (#124491) (#124585)
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)
2024-09-26 13:44:36 -07:00
Miss Islington (bot) 9fc8771942
[3.13] gh-123856: Fix PyREPL failure when a keyboard interrupt is triggered after using a history search (GH-124396) (#124530)
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>
2024-09-26 13:39:01 -07:00
Malcolm Smith 9f5b921491
[3.13] gh-123014: Disable pidfd API on older Android versions (GH-124458) (#124543)
gh-123014: Disable pidfd API on older Android versions (#124458)

(cherry picked from commit c58c572a65)
2024-09-26 13:36:12 -07:00
Alex Waygood 9f2e6ca199
[3.13] gh-101100: Add a table of class attributes to the "Custom classes" section of the data model docs (#124480) (#124556) 2024-09-25 17:29:48 -07:00