Commit Graph

122501 Commits

Author SHA1 Message Date
Miss Islington (bot) 6bc7e2cca5
[3.13] gh-121018: Ensure ArgumentParser.parse_args with exit_on_error=False raises instead of exiting when given unrecognized arguments (GH-121019) (GH-121032)
(cherry picked from commit 0654336dd5)

Co-authored-by: blhsing <blhsing@gmail.com>
2024-06-26 10:16:19 +00:00
Miss Islington (bot) f2b4f517b9
[3.13] gh-120380: fix Python implementation of `pickle.Pickler` for `bytes` and `bytearray` objects in protocol version 5. (GH-120422) (GH-120832)
gh-120380: fix Python implementation of `pickle.Pickler` for `bytes` and `bytearray` objects in protocol version 5. (GH-120422)
(cherry picked from commit 7595e6743a)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-26 12:11:28 +02:00
Miss Islington (bot) 84634254fe
[3.13] gh-121025: Improve partialmethod.__repr__ (GH-121033) (#121037)
gh-121025: Improve partialmethod.__repr__ (GH-121033)

It no longer contains redundant commas and spaces.
(cherry picked from commit d2646e3f45)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-26 09:49:42 +00:00
Miss Islington (bot) 571cefd8c7
[3.13] gh-120155: Fix Coverity issue in parse_string() (GH-120997) (#121005)
gh-120155: Fix Coverity issue in parse_string() (GH-120997)
(cherry picked from commit 769aea3329)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-06-25 19:40:05 +02:00
Miss Islington (bot) f4f8a714b5
[3.13] gh-114053: Fix another edge case involving `get_type_hints`, PEP 695 and PEP 563 (GH-120272) (#121003)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-25 16:30:08 +00:00
Jelle Zijlstra 899dfbaf0e
[3.13] gh-120108: Fix deepcopying of AST trees with .parent attributes (GH-120114) (#121000)
(cherry picked from commit 42b2c9d78d)
2024-06-25 15:39:29 +00:00
Miss Islington (bot) 1764a310e8
[3.13] Doc/README: Document 'make htmllive' (GH-120692) (#120990)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2024-06-25 09:25:54 +00:00
Miss Islington (bot) 6cddf1a611
[3.13] gh-120661: improve example for basic type hints (GH-120934) (#120987)
gh-120661: improve example for basic type hints (GH-120934)
(cherry picked from commit bb057ea107)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-25 09:25:29 +01:00
Miss Islington (bot) d26ce50f7b
[3.13] gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (GH-120822) (#120985)
gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (GH-120822)

Add missing space in AS_VAR_APPEND() on CFLAGS.
(cherry picked from commit 2106c9bef0)

Co-authored-by: Michael Allwright <allsey87@gmail.com>
2024-06-25 08:17:53 +00:00
Miss Islington (bot) 6bfcf98ff6
[3.13] Add --with-lto back to Linux JIT CI (GH-120972)
(cherry picked from commit fd0f814ade)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-06-24 20:44:46 +00:00
Barney Gale 4619f89296
[3.13] GH-119054: Add "Permissions and ownership" section to pathlib docs. (GH-120505) (#120967)
Add dedicated subsection for `pathlib.owner()`, `group()`, `chmod()` and
`lchmod()`.

(cherry picked from commit e4a97a7fb1)
2024-06-24 20:32:08 +01:00
Miss Islington (bot) 0a77058b79
[3.13] gh-120858: PyDict_Next should not lock the dict (GH-120859) (#120964)
PyDict_Next no longer locks the dictionary in the free-threaded build. Locking
around individual PyDict_Next calls is not sufficient because the function
returns borrowed references and because it allows concurrent modifications
during the iteraiton loop.

The internal locking also interferes with correct external synchronization
because it may suspend outer critical sections created by the caller.
(cherry picked from commit 375b723d58)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-06-24 18:41:19 +00:00
Miss Islington (bot) 6aee5edb84
[3.13] gh-120860: Fix a few bugs in `type_setattro` error paths. (GH-120861) (#120963)
Moves the logic to update the type's dictionary to its own function in order
to make the lock scoping more clear.

Also, ensure that `name` is decref'd on the error path.
(cherry picked from commit dee63cb359)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-06-24 18:33:39 +00:00
Petr Viktorin 9769b7ae06
[3.13] gh-113993: Allow interned strings to be mortal, and fix related issues (GH-120520) (GH-120945)
* Add an InternalDocs file describing how interning should work and how to use it.

* Add internal functions to *explicitly* request what kind of interning is done:
  - `_PyUnicode_InternMortal`
  - `_PyUnicode_InternImmortal`
  - `_PyUnicode_InternStatic`

* Switch uses of `PyUnicode_InternInPlace` to those.

* Disallow using `_Py_SetImmortal` on strings directly.
  You should use `_PyUnicode_InternImmortal` instead:
  - Strings should be interned before immortalization, otherwise you're possibly
    interning a immortalizing copy.
  - `_Py_SetImmortal` doesn't handle the `SSTATE_INTERNED_MORTAL` to
    `SSTATE_INTERNED_IMMORTAL` update, and those flags can't be changed in
    backports, as they are now part of public API and version-specific ABI.

* Add private `_only_immortal` argument for `sys.getunicodeinternedsize`, used in refleak test machinery.

* Make sure the statically allocated string singletons are unique. This means these sets are now disjoint:
  - `_Py_ID`
  - `_Py_STR` (including the empty string)
  - one-character latin-1 singletons

  Now, when you intern a singleton, that exact singleton will be interned.

* Add a `_Py_LATIN1_CHR` macro, use it instead of `_Py_ID`/`_Py_STR` for one-character latin-1 singletons everywhere (including Clinic).

* Intern `_Py_STR` singletons at startup.

* For free-threaded builds, intern `_Py_LATIN1_CHR` singletons at startup.

* Beef up the tests. Cover internal details (marked with `@cpython_only`).

* Add lots of assertions

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-06-24 20:24:19 +02:00
Miss Islington (bot) 447e07ab3d
[3.13] gh-119521: Rename IncompleteInputError to _IncompleteInputError and remove from public API/ABI (GH-119680, GH-120955) (GH-120944)
- gh-119521: Rename IncompleteInputError to _IncompleteInputError and remove from public API/ABI (GH-119680)
  (cherry picked from commit ce1064e4c9)

- gh-119521: Use `PyAPI_DATA`, not `extern`, for `_PyExc_IncompleteInputError` (GH-120955)
  (cherry picked from commit ac61d58db0)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-06-24 20:23:30 +02:00
Miss Islington (bot) a19a5895b5
[3.13] docs: puremagic.what() as replacement for imghdr.what() (GH-120871) (#120951)
docs: puremagic.what() as replacement for imghdr.what() (GH-120871)
(cherry picked from commit 22b8a35d6e)

Co-authored-by: Christian Clauss <cclauss@me.com>
2024-06-24 13:49:13 +00:00
Miss Islington (bot) 502a99a7e6
[3.13] gh-120373: Mark test_audit.test_http as requiring the network resource (GH-120374) (#120948)
gh-120373: Mark test_audit.test_http as requiring the network resource (GH-120374)
(cherry picked from commit b0e1c51882)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2024-06-24 13:44:06 +00:00
Miss Islington (bot) 732c00550f
[3.13] gh-119614: Fix truncation of strings with embedded null characters in Tkinter (GH-120909) (GH-120938)
Now the null character is always represented as \xc0\x80 for
Tcl_NewStringObj().
(cherry picked from commit c38e2f64d0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-24 09:45:45 +00:00
Miss Islington (bot) 206028dba9
[3.13] gh-112169: Documented getaddrinfo/getnameinfo default loop executor usage and implications. (GH-112191) (#120935)
gh-112169: Documented getaddrinfo/getnameinfo default loop executor usage and implications. (GH-112191)
(cherry picked from commit fc297b4ba4)

Co-authored-by: Alek Kowalczyk <alek.kowalczyk@gmail.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-06-24 08:55:28 +00:00
Miss Islington (bot) 544a47212b
[3.13] gh-120683: Fix an error in logging.LogRecord timestamp (GH-120709) (GH-120933)
The integer part of the timestamp can be rounded up, while the millisecond
calculation truncates, causing the log timestamp to be wrong by up to 999 ms
(affected roughly 1 in 8 million timestamps).
(cherry picked from commit 1500a23f33)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-24 07:14:26 +00:00
Tian Gao b7240ed3f0
[3.13] gh-119824: Revert the `where` solution and use meta commands (#120919) 2024-06-23 14:11:55 -07:00
Miss Islington (bot) 1aadb51838
[3.13] Docs makefile/RTD: Use uv if installed (GH-120711) (#120922)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-23 19:48:42 +00:00
Miss Islington (bot) 6be1048e27
[3.13] gh-120910: Fix issue resolving relative paths outside site-packages. (GH-120911) (#120917)
gh-120910: Fix issue resolving relative paths outside site-packages. (GH-120911)

Incorporates changes from importlib_metadata 7.2.1.
(cherry picked from commit 1ba0bb21ed)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-06-23 17:30:08 +00:00
Miss Islington (bot) d6791cd933
[3.13] Typing docs: normalize some indents in code examples (GH-120912) (#120915)
Co-authored-by: Nyakku Shigure <sigure.qaq@gmail.com>
2024-06-23 16:31:40 +00:00
Miss Islington (bot) 99f18ea689
[3.13] gh-101830: Fix Tcl_Obj to string conversion (GH-120884) (GH-120905)
Accessing the Tkinter object's string representation no longer converts
the underlying Tcl object to a string on Windows.
(cherry picked from commit f4ddaa3967)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-23 18:33:19 +03:00
Miss Islington (bot) 97acd29541
[3.13] gh-120896: Fix typo in version changed note of `urllib.parse.urlparse()` (GH-120898) (#120902)
gh-120896: Fix typo in version changed note of `urllib.parse.urlparse()` (GH-120898)
(cherry picked from commit b6fa8fe86a)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-06-23 18:28:06 +05:30
Miss Islington (bot) bf7aac3d25
[3.13] gh-119003: Clarify slice assignments (GH-119935) (#120847)
gh-119003: Clarify slice assignments (GH-119935)
(cherry picked from commit 462832041e)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-06-23 18:04:48 +05:30
Nice Zombies 41b2d19912
[3.13] Amend categories of @nineteendo's news entries (GH-120735) (#120850) 2024-06-22 15:05:15 -05:00
Miss Islington (bot) cffead81fa
[3.13] gh-120873: Add tests for new widget options in Tk 8.7 (GH-120877) (GH-120879)
(cherry picked from commit a046c848c1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-22 13:43:30 +00:00
Miss Islington (bot) 61e6b6ab4a
[3.13] gh-120873: Add test for "state" option in ttk.Scale (GH-120874) (GH-120875)
Also refactor the "state" option tests for other ttk widgets.
(cherry picked from commit 974a978631)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-22 11:45:19 +00:00
Miss Islington (bot) a860b1d60b
[3.13] gh-120811: Fix reference leak upon `_PyContext_Exit` failure (GH-120812) (#120843)
gh-120811: Fix reference leak upon `_PyContext_Exit` failure (GH-120812)
(cherry picked from commit aed31beca9)

Co-authored-by: Peter <zintensitydev@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-06-22 16:44:46 +05:30
Miss Islington (bot) 4fabbf9773
[3.13] gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824) (GH-120864)
The tests are now passed with the current version of Tcl/Tk under
development (8.7b1+ and 9.0b3+).

The following changes were also made to make the tests more flexible:

* Helper methods like checkParam() now interpret the expected error message
  as a regular expression instead of a literal.
* Add support of new arguments in checkEnumParam():
  - allow_empty=True skips testing with empty string;
  - fullname= specifies the name for error message if it differs from the
    option name;
  - sort=True sorts values for error message.
* Add support of the allow_empty argument in checkReliefParam():
  allow_empty=True adds an empty string to the list of accepted values.
* Attributes _clip_highlightthickness, _clip_pad and  _clip_borderwidth
  specify how negative values of options -highlightthickness, -padx, -pady
  and -borderwidth are handled.
* Use global variables for some common error messages.

(cherry picked from commit 6ad26de6e8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-06-22 07:17:55 +00:00
Sam Gross 4dc27bc0b7
[3.13] gh-119344: Make critical section API public (GH-119353) (#120856)
This makes the following macros public as part of the non-limited C-API for
locking a single object or two objects at once.

* `Py_BEGIN_CRITICAL_SECTION(op)` / `Py_END_CRITICAL_SECTION()`
* `Py_BEGIN_CRITICAL_SECTION2(a, b)` / `Py_END_CRITICAL_SECTION2()`

The supporting functions and structs used by the macros are also exposed for
cases where C macros are not available.
(cherry picked from commit 8f17d69b7b)
2024-06-21 20:20:41 +00:00
Miss Islington (bot) e748805f2a
[3.13] gh-120838: Add a Note in the Docs About Expectations for Py_Finalize() (gh-120852)
(cherry picked from commit 03fa2df927, AKA gh-120839)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-06-21 19:21:47 +00:00
Miss Islington (bot) abdbf337d4
[3.13] gh-120773: document introspective attributes of an async generator object in the inspect module (GH-120778) (#120827)
gh-120773: document introspective attributes of an async generator object in the inspect module (GH-120778)
(cherry picked from commit 83d3d7aace)

Co-authored-by: blhsing <blhsing@gmail.com>
2024-06-21 16:58:46 +05:30
Miss Islington (bot) f3d7823ede
[3.13] gh-120384: Fix array-out-of-bounds crash in `list_ass_subscript` (GH-120442) (#120826)
gh-120384: Fix array-out-of-bounds crash in `list_ass_subscript` (GH-120442)
(cherry picked from commit 8334a1b55c)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-21 11:16:24 +00:00
Miss Islington (bot) 730285519e
[3.13] gh-111259: Document idiomatic RE pattern (?s:.) that matches any character (GH-120745) (GH-120813)
(cherry picked from commit a2f6f7dd26)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-20 21:22:45 +00:00
Sam Gross 3cb6c4cd60
[3.13] gh-117511: Make PyMutex public in the non-limited API (GH-117731) (#120800)
(cherry picked from commit 3af7263037)
2024-06-20 16:00:25 +00:00
Ken Jin 7c7aa5a99c
[3.13] gh-119258: Backport optimizer frame fixes in GH-119365 (GH-120699)
(cherry picked from commit 55402d3)
2024-06-20 23:55:20 +08:00
Mark Shannon b8fd80f91b
[3.13] GH-119462: Enforce invariants of type versioning. Backport of GH-120731. (#120748)
* Remove uses of Py_TPFLAGS_VALID_VERSION_TAG
2024-06-20 15:09:32 +01:00
Miss Islington (bot) d0a5e40f01
[3.13] Update the documentation howto index page and group docs into 3 logical sections (GH-119366, GH-120703) (GH-120646)
Update the documentation howto index page and group docs into 3 logical sections (GH-119366)

(cherry picked from commit a26d27e7ee)

Includes a follow-up fix to properly merge GH-119877:
* Add a link to free-threading HOWTO to the index (GH-120703)
  (cherry picked from commit 45d5cab533)

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-06-20 10:24:14 +00:00
Jelle Zijlstra 8cfd005b6d
[3.13] gh-119698: fix `symtable.Class.get_methods` and document its behaviour correctly (GH-120151) (#120777)
(cherry picked from commit b8a8e04fec)


Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-19 22:27:23 -07:00
Miss Islington (bot) 5d194902cb
[3.13] Fix typos in comments (GH-120481) (#120774)
(cherry picked from commit 656a1c8108)

Co-authored-by: Xie Yanbo <xieyanbo@gmail.com>
2024-06-20 03:40:54 +00:00
Miss Islington (bot) 6b714d545f
[3.13] GH-120602: Support LLVM_VERSION_SUFFIX for JIT builds (GH-120768)
(cherry picked from commit 285f42c850)

Co-authored-by: Xarblu <xarblu@protonmail.com>
2024-06-20 01:13:23 +00:00
Miss Islington (bot) e415d2561b
[3.13] gh-118820: Zero-valued flag enum has no name (GH-118848) (GH-120759)
gh-118820: Zero-valued flag enum has no name (GH-118848)
(cherry picked from commit ed5ae6c4d7)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-19 15:11:30 -07:00
Miss Islington (bot) 355d928e55
[3.13] gh-120732: Fix `name` passing to `Mock`, when using kwargs to `create_autospec` (GH-120737) (#120760)
gh-120732: Fix `name` passing to `Mock`, when using kwargs to `create_autospec` (GH-120737)
(cherry picked from commit 1e4815692f)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-19 20:59:28 +00:00
Miss Islington (bot) d3918eb89a
[3.13] Regen ``Doc/requirements-oldest-sphinx.txt`` (GH-120753) (#120757)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-06-19 20:10:33 +00:00
Miss Islington (bot) adef569278
[3.13] gh-120521: clarify except* documentation to allow tuples (GH-120523) (#120750)
(cherry picked from commit 58b3f11176)

Co-authored-by: Danny Yang <yangdanny97@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-19 12:07:04 -07:00
Nadeshiko Manju ae04b6f636
[3.13] gh-120437: Fix `_CHECK_STACK_SPACE` optimization problems introduced in gh-118322 (GH-120712) (#120747)
[3.13] gh-120437: Fix `_CHECK_STACK_SPACE` optimization problems introduced in gh-118322 (GH-120712)

Signed-off-by: Manjusaka <me@manjusaka.me>
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2024-06-20 01:40:48 +08:00
Miss Islington (bot) bb5d19440b
[3.13] gh-120635: Avoid leaking processes in test_pyrepl (GH-120676) (#120741)
gh-120635: Avoid leaking processes in test_pyrepl (GH-120676)

If the child process takes longer than SHORT_TIMEOUT seconds to
complete, kill the process but then wait until it completes with no
timeout to not leak child processes.
(cherry picked from commit 0f3e36454d)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-06-19 13:38:37 +00:00