]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
18 months ago[3.13] gh-118846: Fix PGO tests in free-threaded build (GH-118862) (#118867)
Miss Islington (bot) [Thu, 9 May 2024 20:34:22 +0000 (22:34 +0200)] 
[3.13] gh-118846: Fix PGO tests in free-threaded build (GH-118862) (#118867)

Avoid immortalizing objects in tests that verify garbage collection of
classes or modules.

This fixes test_ordered_dict and test_struct.
(cherry picked from commit 1b1db2fd9a531e26b79b34667bccfb938c4d184d)

Co-authored-by: Sam Gross <colesbury@gmail.com>
18 months ago[3.13] gh-116984: Make mimalloc header includes relative to the current file (GH...
Miss Islington (bot) [Thu, 9 May 2024 20:26:36 +0000 (22:26 +0200)] 
[3.13] gh-116984: Make mimalloc header includes relative to the current file (GH-118808) (#118866)

Some embedders and extensions include parts of the internal API. The
pycore_mimalloc.h file is transitively include by a number of other
internal headers. This avoids include errors for code that was
already including those headers.
(cherry picked from commit 71cc0651e79041abd648595f3030dfa41009137a)

Co-authored-by: Sam Gross <colesbury@gmail.com>
18 months ago[3.13] gh-118561: Fix crash involving list.extend in free-threaded build (GH-118723...
Miss Islington (bot) [Thu, 9 May 2024 19:14:47 +0000 (21:14 +0200)] 
[3.13] gh-118561: Fix crash involving list.extend in free-threaded build (GH-118723) (#118863)

The `list_preallocate_exact` function did not zero initialize array
contents. In the free-threaded build, this could expose uninitialized
memory to concurrent readers between the call to
`list_preallocate_exact` and the filling of the array contents with
items.
(cherry picked from commit 2402715e10d00ef60fad2948d8461559d084eb36)

Co-authored-by: Sam Gross <colesbury@gmail.com>
18 months ago[3.13] gh-118849: Fix "code will never be executed" warning in `dictobject.c` (GH...
Miss Islington (bot) [Thu, 9 May 2024 17:40:48 +0000 (19:40 +0200)] 
[3.13] gh-118849: Fix "code will never be executed" warning in `dictobject.c` (GH-118850) (#118859)

gh-118849: Fix "code will never be executed" warning in `dictobject.c` (GH-118850)
(cherry picked from commit 82abe75e77129bebb3c13d807e8040f6924194f6)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
18 months agogh-118773: Use language-invariant SDDL string instead of aliases for ACLs. (GH-118800)
Miss Islington (bot) [Thu, 9 May 2024 17:11:11 +0000 (19:11 +0200)] 
gh-118773: Use language-invariant SDDL string instead of aliases for ACLs. (GH-118800)

(cherry picked from commit 8af84b503d0b62a3db0d806d39f42c1e08746079)

Co-authored-by: Steve Dower <steve.dower@python.org>
18 months ago[3.13] gh-117657: Acquire a critical section around `SemLock.__{enter,exit}__` (GH...
Miss Islington (bot) [Thu, 9 May 2024 16:31:38 +0000 (18:31 +0200)] 
[3.13] gh-117657: Acquire a critical section around `SemLock.__{enter,exit}__` (GH-118812) (#118856)

These methods are purely wrappers around `Semlock.{acquire,release}`,
which expect a critical section to be held.
(cherry picked from commit c30d8e5d6c6b657817d6b342f1021676d04dd5af)

Co-authored-by: mpage <mpage@meta.com>
18 months ago[3.13] gh-118817: Fix `asyncio REPL` on Windows (GH-118819) (#118847)
Miss Islington (bot) [Thu, 9 May 2024 15:47:31 +0000 (17:47 +0200)] 
[3.13] gh-118817: Fix `asyncio REPL` on Windows (GH-118819) (#118847)

(cherry picked from commit c3643a121401d111bebd3e26d6f362ade2ed2a83)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
18 months agogh-118802: Fix ACL use in test for non-English Windows (GH-118831)
Miss Islington (bot) [Thu, 9 May 2024 13:38:43 +0000 (15:38 +0200)] 
gh-118802: Fix ACL use in test for non-English Windows (GH-118831)

(cherry picked from commit 82acc5f2113bffd0ed902851f4ccf5b9be8980b2)

Co-authored-by: Steve Dower <steve.dower@python.org>
18 months ago[3.13] gh-103956: Fix `trace` output in case of missing source line (GH-103958) ...
Miss Islington (bot) [Thu, 9 May 2024 13:05:37 +0000 (15:05 +0200)] 
[3.13] gh-103956: Fix `trace` output in case of missing source line (GH-103958) (GH-118834)

Print only filename with lineno if linecache.getline() returns an empty string.
(cherry picked from commit 7c87ce777b3fd9055b118a58ec8614901ecb45e9)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
18 months agogh-118486: Update docs for CVE-2024-4030 reference (GH-118737)
Steve Dower [Thu, 9 May 2024 11:52:11 +0000 (12:52 +0100)] 
gh-118486: Update docs for CVE-2024-4030 reference (GH-118737)

Update docs for CVE-2024-4030 reference

18 months ago[3.13] gh-118033: Fix `__weakref__` not set for generic dataclasses (GH-118099) ...
Miss Islington (bot) [Thu, 9 May 2024 09:02:22 +0000 (11:02 +0200)] 
[3.13] gh-118033: Fix `__weakref__` not set for generic dataclasses (GH-118099) (#118821)

gh-118033: Fix `__weakref__` not set for generic dataclasses (GH-118099)
(cherry picked from commit fa9b9cb11379806843ae03b1e4ad4ccd95a63c02)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
18 months ago[3.13] [tests]: Mark ``test_statistics.test_kde_random`` with a ``requires_resource...
Miss Islington (bot) [Thu, 9 May 2024 08:43:03 +0000 (10:43 +0200)] 
[3.13] [tests]: Mark ``test_statistics.test_kde_random`` with a ``requires_resource('cpu')`` decorator (GH-118801) (#118818)

[tests]: Mark ``test_statistics.test_kde_random`` with a ``requires_resource('cpu')`` decorator (GH-118801)

Mark test_kde_random with a requires_resource('cpu') decorator
(cherry picked from commit 027e6d88fb898b7477b822b84f791ca60e64300b)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
18 months ago[3.13] gh-117657: Fix data races when writing / reading `ob_gc_bits` (GH-118292)...
Miss Islington (bot) [Wed, 8 May 2024 21:31:37 +0000 (23:31 +0200)] 
[3.13] gh-117657: Fix data races when writing / reading `ob_gc_bits` (GH-118292) (#118796)

Use relaxed atomics when reading / writing to the field. There are still a
few places in the GC where we do not use atomics. Those should be safe as
the world is stopped.
(cherry picked from commit cb6f75a32ca2649c6cc1cabb0301eb783efbd55b)

Co-authored-by: mpage <mpage@meta.com>
18 months ago[3.13] Format None, True, False and NotImplemented as literals (GH-118758) (GH-118792)
Miss Islington (bot) [Wed, 8 May 2024 19:55:12 +0000 (21:55 +0200)] 
[3.13] Format None, True, False and NotImplemented as literals (GH-118758) (GH-118792)

(cherry picked from commit 05c2fe1acda9ea5a57061642c36e8b73bb4fbba4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
18 months ago[3.13] docs: module page titles should not start with a link to themselves (GH-117099...
Miss Islington (bot) [Wed, 8 May 2024 19:52:39 +0000 (21:52 +0200)] 
[3.13] docs: module page titles should not start with a link to themselves (GH-117099) (#118790)

docs: module page titles should not start with a link to themselves (GH-117099)
(cherry picked from commit bcb435ee8ff41b5ec5d879ee0b6651f146a66151)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
18 months ago[3.13] gh-118772: Allow TypeVars without a default to follow those with a default...
Miss Islington (bot) [Wed, 8 May 2024 19:31:41 +0000 (21:31 +0200)] 
[3.13] gh-118772: Allow TypeVars without a default to follow those with a default when constructing aliases (GH-118774) (#118776)

(cherry picked from commit aac6b019fe91e2f9f7a955d4fc4db5d5efd968c9)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
18 months ago[3.13] Docs: fix typos in documentation (GH-118752) (#118787)
Miss Islington (bot) [Wed, 8 May 2024 19:24:39 +0000 (21:24 +0200)] 
[3.13] Docs: fix typos in documentation (GH-118752) (#118787)

Docs: fix typos in documentation (GH-118752)
(cherry picked from commit 7b0c247f1c176e092777fce4677a00f22c738b3c)

Co-authored-by: Xie Yanbo <xieyanbo@gmail.com>
18 months ago[3.13] Run CI on the 3.13 branch (GH-118779) (#118781)
Miss Islington (bot) [Wed, 8 May 2024 18:43:25 +0000 (20:43 +0200)] 
[3.13] Run CI on the 3.13 branch (GH-118779) (#118781)

(cherry picked from commit c68311df8543384e04fe994b3d4f4718cca1040e)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
18 months agoPost 3.13.0b1
Thomas Wouters [Wed, 8 May 2024 14:53:50 +0000 (16:53 +0200)] 
Post 3.13.0b1

18 months agoPython 3.13.0b1 v3.13.0b1
Thomas Wouters [Wed, 8 May 2024 09:10:41 +0000 (11:10 +0200)] 
Python 3.13.0b1

18 months agogh-118671: Updated dead ActiveState links (#118730)
trag1c [Wed, 8 May 2024 07:06:38 +0000 (09:06 +0200)] 
gh-118671: Updated dead ActiveState links (#118730)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
18 months agoRegen ``Doc/requirements-oldest-sphinx.txt`` (#118736)
Kirill Podoprigora [Wed, 8 May 2024 05:59:17 +0000 (08:59 +0300)] 
Regen ``Doc/requirements-oldest-sphinx.txt`` (#118736)

Regen dependencies

18 months agogh-118746: Fix crash in frame_getlocals and _PyFrame_GetLocals (#118748)
Tian Gao [Wed, 8 May 2024 00:48:05 +0000 (17:48 -0700)] 
gh-118746: Fix crash in frame_getlocals and _PyFrame_GetLocals (#118748)

We don't know how to create an unoptimized frame with f_locals == NULL,
but they are seen in the wild, and this fixes the crash.

18 months agogh-118610: Centralize power caching in `_pylong.py` (#118611)
Tim Peters [Wed, 8 May 2024 00:09:09 +0000 (19:09 -0500)] 
gh-118610: Centralize power caching in `_pylong.py` (#118611)

A new `compute_powers()` function computes all and only the powers of the base the various base-conversion functions need, as efficiently as reasonably possible (turns out that invoking `**`is needed at most once). This typically gives a few % speedup, but the primary point is to simplify the base-conversion functions, which no longer need their own, ad hoc, and less efficient power-caching schemes.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
18 months agoRevert to free macOS runners (#118744)
Łukasz Langa [Tue, 7 May 2024 23:40:38 +0000 (01:40 +0200)] 
Revert to free macOS runners (#118744)

18 months agogh-118734: Fixes Windows build when Use_TIER2 is unspecified (#118735)
Steve Dower [Tue, 7 May 2024 21:01:18 +0000 (22:01 +0100)] 
gh-118734: Fixes Windows build when Use_TIER2 is unspecified (#118735)

18 months agogh-109975: Make a rough editorial pass over What's New (#118711)
T. Wouters [Tue, 7 May 2024 21:00:25 +0000 (23:00 +0200)] 
gh-109975: Make a rough editorial pass over What's New (#118711)

Make a rough editorial pass over Python 3.13's What's New document. Add the
release highlights, remove or merge some duplicated entries, and reorder
some of the sections (removals should really go before future deprecations).

18 months agogh-118518: Check for perf version and not kernel version in test_perf_profiler (...
Pablo Galindo Salgado [Tue, 7 May 2024 19:41:07 +0000 (20:41 +0100)] 
gh-118518: Check for perf version and not kernel version in test_perf_profiler (#118640)

18 months agogh-118729: Temporarily skip `test_multiprocessing_pool_circular_import` (#118732)
Sam Gross [Tue, 7 May 2024 19:27:28 +0000 (15:27 -0400)] 
gh-118729: Temporarily skip `test_multiprocessing_pool_circular_import` (#118732)

The `pool_in_threads.py` test file may crash in free-threaded builds,
which can lead to the Tsan test hanging. Skip it for now until we fix
the underlying issue.

18 months agogh-118650: Document `Enum._repr_*` reservation exclusion (GH-118698)
chrysn [Tue, 7 May 2024 18:11:18 +0000 (20:11 +0200)] 
gh-118650: Document `Enum._repr_*` reservation exclusion (GH-118698)

18 months agogh-118518: Improve perf docs (#118708)
Pablo Galindo Salgado [Tue, 7 May 2024 16:25:15 +0000 (17:25 +0100)] 
gh-118518: Improve perf docs (#118708)

18 months agogh-111201: Allow pasted code to contain multiple statements in the REPL (#118712)
Pablo Galindo Salgado [Tue, 7 May 2024 16:01:49 +0000 (17:01 +0100)] 
gh-111201: Allow pasted code to contain multiple statements in the REPL (#118712)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
18 months agobpo-115773: Use the right variable name based on the field we are trying read (#118591)
Abhinav Upadhyay [Tue, 7 May 2024 14:50:41 +0000 (20:20 +0530)] 
bpo-115773: Use the right variable name based on the field we are trying read (#118591)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
18 months agogh-118682: Revert forcing str commands, allow class commands in pyrepl (#118709)
Lysandros Nikolaou [Tue, 7 May 2024 14:31:56 +0000 (16:31 +0200)] 
gh-118682: Revert forcing str commands, allow class commands in pyrepl (#118709)

18 months agogh-118660: Add second type parameter to (Async)ContextManager (#118681)
Jelle Zijlstra [Tue, 7 May 2024 14:16:05 +0000 (07:16 -0700)] 
gh-118660: Add second type parameter to (Async)ContextManager (#118681)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
18 months agoRemove Python 3.5 hardcoded version in the tutorial appendix (GH-117612)
Kerim Kabirov [Tue, 7 May 2024 13:28:16 +0000 (15:28 +0200)] 
Remove Python 3.5 hardcoded version in the tutorial appendix (GH-117612)

18 months agogh-111201: Allow bracketed paste to work (GH-118700)
Pablo Galindo Salgado [Tue, 7 May 2024 12:54:56 +0000 (13:54 +0100)] 
gh-111201: Allow bracketed paste to work (GH-118700)

18 months agoRemove several unused imports in `_pyrepl` (#118668)
Nikita Sobolev [Tue, 7 May 2024 12:43:18 +0000 (15:43 +0300)] 
Remove several unused imports in `_pyrepl` (#118668)

18 months agogh-66410: Do not stringify arguments of Tkinter callback (GH-98592)
Serhiy Storchaka [Tue, 7 May 2024 12:07:32 +0000 (15:07 +0300)] 
gh-66410: Do not stringify arguments of Tkinter callback (GH-98592)

Callbacks registered in the tkinter module now take arguments as
various Python objects (int, float, bytes, tuple), not just str.
To restore the previous behavior set tkinter module global wantobject to 1
before creating the Tk object or call the wantobject() method of the Tk object
with argument 1.
Calling it with argument 2 restores the current default behavior.

18 months agogh-118090: Improve error message for empty type param brackets (GH-118091)
Nikita Sobolev [Tue, 7 May 2024 12:01:06 +0000 (15:01 +0300)] 
gh-118090: Improve error message for empty type param brackets (GH-118091)

18 months agogh-118518: Rename `PYTHONPERFJITSUPPORT` and `-X perfjit` with underscores (#118693)
Hugo van Kemenade [Tue, 7 May 2024 11:47:21 +0000 (13:47 +0200)] 
gh-118518: Rename `PYTHONPERFJITSUPPORT` and `-X perfjit` with underscores (#118693)

18 months agogh-118310: Fix documentation for `enum.Enum.__new__` (GH-118311)
Momo Eissenhauer [Tue, 7 May 2024 11:42:18 +0000 (13:42 +0200)] 
gh-118310: Fix documentation for `enum.Enum.__new__` (GH-118311)

The provided example was incorrect:
- The example enum was missing the `int` mixin as implied by the context
- The value of `int('1a', 16)` was incorrectly given as 17
  (should be 26)

18 months agogh-109653: What's new: Note improved import times for several stdlib modules in Pytho...
Alex Waygood [Tue, 7 May 2024 11:34:19 +0000 (12:34 +0100)] 
gh-109653: What's new: Note improved import times for several stdlib modules in Python 3.13 (#118697)

18 months agogh-118418: Deprecate failing to pass a value to the *type_params* parameter of some...
Alex Waygood [Tue, 7 May 2024 11:12:28 +0000 (12:12 +0100)] 
gh-118418: Deprecate failing to pass a value to the *type_params* parameter of some private `typing` APIs (#118695)

18 months agogh-118119: Re-use `sep` in `posixpath.expanduser()` (GH-118120)
Nice Zombies [Tue, 7 May 2024 10:50:40 +0000 (12:50 +0200)] 
gh-118119: Re-use `sep` in `posixpath.expanduser()` (GH-118120)

18 months agogh-118650: Exclude `_repr_*` methods from Enum's _sunder_ reservation (GH-118651)
chrysn [Tue, 7 May 2024 10:35:51 +0000 (12:35 +0200)] 
gh-118650: Exclude `_repr_*` methods from Enum's _sunder_ reservation (GH-118651)

18 months agogh-109975: Update 'What's New in Python 3.13' for beta (#118694)
Hugo van Kemenade [Tue, 7 May 2024 10:35:32 +0000 (12:35 +0200)] 
gh-109975: Update 'What's New in Python 3.13' for beta (#118694)

18 months agoFix several typos in documentation (GH-118625)
Xie Yanbo [Tue, 7 May 2024 09:23:06 +0000 (17:23 +0800)] 
Fix several typos in documentation (GH-118625)

18 months agogh-118314: Fix padding edge case in binascii.a2b_base64 strict mode (GH-118320)
Youfu Zhang [Tue, 7 May 2024 09:18:45 +0000 (17:18 +0800)] 
gh-118314: Fix padding edge case in binascii.a2b_base64 strict mode (GH-118320)

Fix an edge case in `binascii.a2b_base64` strict mode, where
excessive padding was not detected when no padding is necessary.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
18 months agogh-117657: Use clang 18 in TSAN builds (GH-118533)
mpage [Tue, 7 May 2024 09:04:01 +0000 (02:04 -0700)] 
gh-117657: Use clang 18 in TSAN builds (GH-118533)

Use clang 18 in TSAN builds

We were using clang 14 which is a couple of years old.

18 months agoFix typo inaccuracy in _bootstrap_external.py (GH-118619)
wim glenn [Tue, 7 May 2024 08:52:48 +0000 (03:52 -0500)] 
Fix typo inaccuracy in _bootstrap_external.py (GH-118619)

18 months agogh-62090: Simplify argparse usage formatting (GH-105039)
Ali Hamdan [Tue, 7 May 2024 07:28:51 +0000 (10:28 +0300)] 
gh-62090: Simplify argparse usage formatting (GH-105039)

Rationale
=========

argparse performs a complex formatting of the usage for argument grouping
and for line wrapping to fit the terminal width. This formatting has been
a constant source of bugs for at least 10 years (see linked issues below)
where defensive assertion errors are triggered or brackets and paranthesis
are not properly handeled.

Problem
=======

The current implementation of argparse usage formatting relies on regular
expressions to group arguments usage only to separate them again later
with another set of regular expressions. This is a complex and error prone
approach that caused all the issues linked below. Special casing certain
argument formats has not solved the problem. The following are some of
the most common issues:
- empty `metavar`
- mutually exclusive groups with `SUPPRESS`ed arguments
- metavars with whitespace
- metavars with brackets or paranthesis

Solution
========

The following two comments summarize the solution:
- https://github.com/python/cpython/issues/82091#issuecomment-1093832187
- https://github.com/python/cpython/issues/77048#issuecomment-1093776995

Mainly, the solution is to rewrite the usage formatting to avoid the
group-then-separate approach. Instead, the usage parts are kept separate
and only joined together at the end. This allows for a much simpler
implementation that is easier to understand and maintain. It avoids the
regular expressions approach and fixes the corresponding issues.

This closes the following GitHub issues:
-  #62090
-  #62549
-  #77048
-  #82091
-  #89743
-  #96310
-  #98666

These PRs become obsolete:
-  #15372
-  #96311

18 months agogh-118107: Fix zipimporter ZIP64 handling. (GH-118108)
John Sirois [Tue, 7 May 2024 07:23:27 +0000 (02:23 -0500)] 
gh-118107: Fix zipimporter ZIP64 handling. (GH-118108)

Add missing import to code that handles too large files and offsets.
Use list, not tuple, for a mutable sequence.

Add tests to prevent similar mistakes.

---------

Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
18 months agoUpdate macOS installer screens and README for 3.13.0b1 (GH-118685)
Ned Deily [Tue, 7 May 2024 04:49:07 +0000 (00:49 -0400)] 
Update macOS installer screens and README for 3.13.0b1 (GH-118685)

18 months agogh-118414: Fix assertion in YIELD_VALUE when tracing lines or instrs (#118683)
Tian Gao [Tue, 7 May 2024 04:22:59 +0000 (21:22 -0700)] 
gh-118414: Fix assertion in YIELD_VALUE when tracing lines or instrs (#118683)

18 months agogh-117953: Always Run Extension Init Func in Main Interpreter First (gh-118157)
Eric Snow [Tue, 7 May 2024 04:21:51 +0000 (22:21 -0600)] 
gh-117953: Always Run Extension Init Func in Main Interpreter First (gh-118157)

This change makes sure all extension/builtin modules have their init function run first by the main interpreter before proceeding with import in the original interpreter (main or otherwise).  This means when the import of a single-phase init module fails in an isolated subinterpreter, it won't tie any global state/callbacks to the subinterpreter.

18 months agogh-117953: Imply Single-phase Init if the Init Function Fails (gh-118684)
Eric Snow [Tue, 7 May 2024 03:16:22 +0000 (21:16 -0600)] 
gh-117953: Imply Single-phase Init if the Init Function Fails (gh-118684)

This ensures the kind is always either _Py_ext_module_kind_SINGLEPHASE or _Py_ext_module_kind_MULTIPHASE.

18 months agogh-116322: Enable the GIL while loading C extension modules (#118560)
Brett Simmers [Tue, 7 May 2024 03:07:23 +0000 (20:07 -0700)] 
gh-116322: Enable the GIL while loading C extension modules (#118560)

Add the ability to enable/disable the GIL at runtime, and use that in
the C module loading code.

We can't know before running a module init function if it supports
free-threading, so the GIL is temporarily enabled before doing so. If
the module declares support for running without the GIL, the GIL is
later disabled. Otherwise, the GIL is permanently enabled, and will
never be disabled again for the life of the current interpreter.

18 months agoDocs: add whatsnew for free-threading (#118679)
Sam Gross [Tue, 7 May 2024 01:48:28 +0000 (21:48 -0400)] 
Docs: add whatsnew for free-threading (#118679)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
18 months agogh-110209: Add __class_getitem__ for generator and coroutine (#110212)
James Hilton-Balfe [Tue, 7 May 2024 01:41:32 +0000 (02:41 +0100)] 
gh-110209: Add __class_getitem__ for generator and coroutine (#110212)

18 months agoGH-116380: Revert move of pathlib globbing code to `pathlib._glob` (#118678)
Barney Gale [Tue, 7 May 2024 00:32:48 +0000 (01:32 +0100)] 
GH-116380: Revert move of pathlib globbing code to `pathlib._glob` (#118678)

The previous change made the `glob` module slower to import, because it
imported `pathlib._glob` and hence the rest of `pathlib`.

Reverts a40f557d7b7a355a55bb90c068e3e9202fd9c8f2.

18 months agogh-112075: use per-thread dict version pool (#118676)
Dino Viehland [Tue, 7 May 2024 00:22:26 +0000 (17:22 -0700)] 
gh-112075: use per-thread dict version pool (#118676)

use thread state set of dict versions

18 months agogh-118527: Intern code consts in free-threaded build (#118667)
Sam Gross [Tue, 7 May 2024 00:12:39 +0000 (20:12 -0400)] 
gh-118527: Intern code consts in free-threaded build (#118667)

We already intern and immortalize most string constants. In the
free-threaded build, other constants can be a source of reference count
contention because they are shared by all threads running the same code
objects.

18 months agogh-118473: Fix set_asyncgen_hooks not to be partially set when arguments are invalid...
Jeong, YunWon [Tue, 7 May 2024 00:02:52 +0000 (09:02 +0900)] 
gh-118473: Fix set_asyncgen_hooks not to be partially set when arguments are invalid (#118474)

18 months agogh-118362: Skip tests when threading isn't available (#118666)
Dino Viehland [Mon, 6 May 2024 23:45:04 +0000 (16:45 -0700)] 
gh-118362: Skip tests when threading isn't available (#118666)

* Skip tests when threads aren't available

* Use ThreadPoolExecutor

18 months agogh-112075: Fix race in constructing dict for instance (#118499)
Dino Viehland [Mon, 6 May 2024 23:31:09 +0000 (16:31 -0700)] 
gh-112075: Fix race in constructing dict for instance (#118499)

18 months agoGH-118251: Bump the JIT CI timeout to 90 minutes (#118661)
Brandt Bucher [Mon, 6 May 2024 23:21:39 +0000 (16:21 -0700)] 
GH-118251: Bump the JIT CI timeout to 90 minutes (#118661)

18 months agogh-117486: Improve behavior for user-defined AST subclasses (#118212)
Jelle Zijlstra [Mon, 6 May 2024 22:57:27 +0000 (15:57 -0700)] 
gh-117486: Improve behavior for user-defined AST subclasses (#118212)

Now, such classes will no longer require changes in Python 3.13 in the normal case.
The test suite for robotframework passes with no DeprecationWarnings under this PR.

I also added a new DeprecationWarning for the case where `_field_types` exists
but is incomplete, since that seems likely to indicate a user mistake.

18 months agofix typo in `_pyrepl.pager`: `plainpager` -> `plain_pager` (#118675)
denballakh [Mon, 6 May 2024 22:56:28 +0000 (01:56 +0300)] 
fix typo in `_pyrepl.pager`: `plainpager` -> `plain_pager` (#118675)

18 months agoUse Intel with 12 cores for free-threading tests for maximum speedup (#118677)
Łukasz Langa [Mon, 6 May 2024 22:49:45 +0000 (00:49 +0200)] 
Use Intel with 12 cores for free-threading tests for maximum speedup (#118677)

18 months agogh-118647: Add defaults to typing.Generator and typing.AsyncGenerator (#118648)
Jelle Zijlstra [Mon, 6 May 2024 22:35:06 +0000 (15:35 -0700)] 
gh-118647: Add defaults to typing.Generator and typing.AsyncGenerator (#118648)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
18 months agoTest premium Mac builders (#118672)
Łukasz Langa [Mon, 6 May 2024 22:08:17 +0000 (00:08 +0200)] 
Test premium Mac builders (#118672)

18 months agogh-118527: Intern code name and filename on default build (#118576)
Sam Gross [Mon, 6 May 2024 21:24:14 +0000 (17:24 -0400)] 
gh-118527: Intern code name and filename on default build (#118576)

Interned and non-interned strings are treated differently by `marshal`,
so be consistent between the default and free-threaded build.

18 months agoGH-115709: Invalidate executors when a local variable is changed via frame.f_locals...
Mark Shannon [Mon, 6 May 2024 21:21:06 +0000 (22:21 +0100)] 
GH-115709: Invalidate executors when a local variable is changed via frame.f_locals (#118639)

Also fix unrelated assert in debug Tier2/JIT builds.

18 months agogh-118415: Fix issues with local tracing being enabled/disabled on a function (#118496)
Dino Viehland [Mon, 6 May 2024 20:06:09 +0000 (13:06 -0700)] 
gh-118415: Fix issues with local tracing being enabled/disabled on a function (#118496)

18 months agogh-118628: Don't display pyrepl warning on Windows (#118665)
Łukasz Langa [Mon, 6 May 2024 19:35:22 +0000 (21:35 +0200)] 
gh-118628: Don't display pyrepl warning on Windows (#118665)

18 months agogh-71592: Fix a leak in tkinter.Tk destructor when _debug is true (GH-118664)
Serhiy Storchaka [Mon, 6 May 2024 19:25:20 +0000 (22:25 +0300)] 
gh-71592: Fix a leak in tkinter.Tk destructor when _debug is true (GH-118664)

18 months agogh-115119: Default to --with-system-libmpdec=yes (#118539)
Erlend E. Aasland [Mon, 6 May 2024 19:16:08 +0000 (21:16 +0200)] 
gh-115119: Default to --with-system-libmpdec=yes (#118539)

Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
18 months agoGH-83151: Add closure support to pdb (GH-111094)
Tian Gao [Mon, 6 May 2024 18:34:13 +0000 (11:34 -0700)] 
GH-83151: Add closure support to pdb (GH-111094)

18 months agogh-118362: Fix thread safety around lookups from the type cache in the face of concur...
Dino Viehland [Mon, 6 May 2024 17:50:35 +0000 (10:50 -0700)] 
gh-118362: Fix thread safety around lookups from the type cache in the face of concurrent mutators (#118454)

Add _PyType_LookupRef and use incref before setting attribute on type
Makes setting an attribute on a class and signaling type modified atomic
Avoid adding re-entrancy exposing the type cache in an inconsistent state by decrefing after type is updated

18 months agogh-118518: Ensure that the code padding it's applied (#118654)
Pablo Galindo Salgado [Mon, 6 May 2024 17:20:42 +0000 (18:20 +0100)] 
gh-118518: Ensure that the code padding it's applied (#118654)

18 months agoGH-117714: implement athrow().close() and asend().close() using throw (GH-117906)
Thomas Grainger [Mon, 6 May 2024 17:13:15 +0000 (18:13 +0100)] 
GH-117714: implement athrow().close() and asend().close() using throw (GH-117906)

* GH-117714: replace athrow().close() and asend().close() stubs with implimentations

* test athrow().close() and asend().close() raises RuntimeError

* 📜🤖 Added by blurb_it.

* Update Objects/genobject.c

Co-authored-by: Petr Viktorin <encukou@gmail.com>
---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
18 months agogh-71592: Add ability to trace Tcl commands executed by Tkinter (GH-118291)
Serhiy Storchaka [Mon, 6 May 2024 17:12:51 +0000 (20:12 +0300)] 
gh-71592: Add ability to trace Tcl commands executed by Tkinter (GH-118291)

This is an experimental feature, for internal use.

Setting tkinter._debug = True before creating the root window enables
printing every executed Tcl command (or a Tcl command equivalent to the
used Tcl C API).

This will help to convert a Tkinter example into Tcl script to check
whether the issue is caused by Tkinter or exists in the underlying Tcl/Tk
library.

18 months agogh-116322: Rename PyModule_ExperimentalSetGIL to PyUnstable_Module_SetGIL (GH-118645)
Petr Viktorin [Mon, 6 May 2024 16:59:36 +0000 (18:59 +0200)] 
gh-116322: Rename PyModule_ExperimentalSetGIL to PyUnstable_Module_SetGIL (GH-118645)

18 months agoGH-115577 Clarify netloc term usage in urllib.parse docs (GH-117632)
Kerim Kabirov [Mon, 6 May 2024 16:55:22 +0000 (18:55 +0200)] 
GH-115577 Clarify netloc term usage in urllib.parse docs (GH-117632)

18 months agogh-118609: Add proper error check for framelocalsproxy (#118615)
Tian Gao [Mon, 6 May 2024 15:46:15 +0000 (08:46 -0700)] 
gh-118609: Add proper error check for framelocalsproxy (#118615)

18 months agogh-118271: Support more options for reading/writing images in Tkinter (GH-118273)
Serhiy Storchaka [Mon, 6 May 2024 15:06:06 +0000 (18:06 +0300)] 
gh-118271: Support more options for reading/writing images in Tkinter (GH-118273)

* Add PhotoImage.read() to read an image from a file.
* Add PhotoImage.data() to get the image data.
* Add background and grayscale parameters to PhotoImage.write().

18 months agoFix typo in Doc/library/asyncio-task.rst (GH-118627)
Xie Yanbo [Mon, 6 May 2024 15:00:31 +0000 (23:00 +0800)] 
Fix typo in Doc/library/asyncio-task.rst (GH-118627)

18 months agogh-118225: Support more options for copying images in Tkinter (GH-118228)
Serhiy Storchaka [Mon, 6 May 2024 14:33:15 +0000 (17:33 +0300)] 
gh-118225: Support more options for copying images in Tkinter (GH-118228)

* Add the PhotoImage method copy_replace() to copy a region
  from one image to other image, possibly with pixel zooming and/or
  subsampling.
* Add from_coords parameter to PhotoImage methods copy(), zoom() and subsample().
* Add zoom and subsample parameters to PhotoImage method copy().

18 months agogh-118518: Correct type of perf_profiling in config (#118646)
Pablo Galindo Salgado [Mon, 6 May 2024 14:30:30 +0000 (15:30 +0100)] 
gh-118518: Correct type of perf_profiling in config (#118646)

18 months agoFix typo in Lib/zipfile/_path/__init__.py (#118622)
Xie Yanbo [Mon, 6 May 2024 13:58:27 +0000 (21:58 +0800)] 
Fix typo in Lib/zipfile/_path/__init__.py (#118622)

18 months agogh-116871: Improve name suggestions in tracebacks (GH-116930)
Serhiy Storchaka [Mon, 6 May 2024 12:53:15 +0000 (15:53 +0300)] 
gh-116871: Improve name suggestions in tracebacks (GH-116930)

Only include underscored names in name suggestions for AttributeError and
ImportError if the original name was underscored.

18 months agogh-66543: Add mimetypes.guess_file_type() (GH-117258)
Serhiy Storchaka [Mon, 6 May 2024 12:50:52 +0000 (15:50 +0300)] 
gh-66543: Add mimetypes.guess_file_type() (GH-117258)

18 months agogh-111201: Use a more common constant in completion tests in test_pyrepl (#118638)
Pablo Galindo Salgado [Mon, 6 May 2024 10:56:47 +0000 (11:56 +0100)] 
gh-111201: Use a more common constant in completion tests in test_pyrepl (#118638)

18 months agogh-74929: Make containment checks more efficient in `FrameLocalsProxy` (#118624)
Tian Gao [Mon, 6 May 2024 10:16:48 +0000 (03:16 -0700)] 
gh-74929: Make containment checks more efficient in `FrameLocalsProxy` (#118624)

Properly implement the `sq_contains` slot for frame locals proxy containment checks.

18 months agogh-74929: locals() documentation update for PEP 667 (#118265)
Alyssa Coghlan [Mon, 6 May 2024 10:06:07 +0000 (20:06 +1000)] 
gh-74929: locals() documentation update for PEP 667 (#118265)

Documentation wording taken from the
withdrawn PEP 558 (which had switched to the
Python level semantics proposed in PEP 667 prior
to its withdrawal).

18 months agogh-111201: Fix event queue tests for pyrepl (#118635)
Lysandros Nikolaou [Mon, 6 May 2024 09:50:42 +0000 (11:50 +0200)] 
gh-111201: Fix event queue tests for pyrepl (#118635)

18 months agogh-118465: Add __firstlineno__ attribute to class (GH-118475)
Serhiy Storchaka [Mon, 6 May 2024 09:02:37 +0000 (12:02 +0300)] 
gh-118465: Add __firstlineno__ attribute to class (GH-118475)

It is set by compiler with the line number of the first line of
the class definition.

18 months agogh-115119: Bump CI to use Ubuntu 22.04 (#118631)
Erlend E. Aasland [Mon, 6 May 2024 08:39:43 +0000 (10:39 +0200)] 
gh-115119: Bump CI to use Ubuntu 22.04 (#118631)

Ubuntu 22.04 ships with mpdecimal 2.5.1, installable using 'apt install libmpdec-dev'.

18 months agogh-95382: Improve performance of json encoder with indent (GH-118105)
Pieter Eendebak [Mon, 6 May 2024 08:04:39 +0000 (10:04 +0200)] 
gh-95382: Improve performance of json encoder with indent (GH-118105)