]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
17 months agogh-117655: Prevent `test_strptime` from raising a DeprecationWarning (GH-117668)
Nice Zombies [Sat, 11 May 2024 21:46:07 +0000 (23:46 +0200)] 
gh-117655: Prevent `test_strptime` from raising a DeprecationWarning (GH-117668)

* Fix `test_strptime` raises a DeprecationWarning
* Ignore deprecation warnings where appropriate.
* Update Lib/test/datetimetester.py

This is follow on work to silence unnecessary warnings from the test suite that changes for https://github.com/python/cpython/issues/70647 added.

17 months agogh-118932: ChainMap.__contains__ performance improvement (gh-118946)
d.grigonis [Sat, 11 May 2024 20:55:23 +0000 (23:55 +0300)] 
gh-118932: ChainMap.__contains__ performance improvement (gh-118946)

17 months agoDocs: Fix SOURCE_URI (#118945)
Nice Zombies [Sat, 11 May 2024 11:47:45 +0000 (13:47 +0200)] 
Docs: Fix SOURCE_URI (#118945)

17 months agogh-118921: Add `copy()` method for `FrameLocalsProxy` (#118923)
Tian Gao [Fri, 10 May 2024 22:53:10 +0000 (15:53 -0700)] 
gh-118921: Add `copy()` method for `FrameLocalsProxy` (#118923)

17 months agogh-117657: Log TSAN warnings to separate files and archive them (#118747)
mpage [Fri, 10 May 2024 21:54:23 +0000 (14:54 -0700)] 
gh-117657: Log TSAN warnings to separate files and archive them (#118747)

This ensures we don't lose races that occur in subprocesses or
interleave races from workers running in parallel.

Log files are collected and packaged into a zipfile that can be
downloaded from the "Artifacts" section of the workflow run.

17 months agogh-118924: Remove `sqlite3.version` and `sqlite3.version_info` (#118925)
Hugo van Kemenade [Fri, 10 May 2024 20:42:34 +0000 (23:42 +0300)] 
gh-118924: Remove `sqlite3.version` and `sqlite3.version_info` (#118925)

17 months agogh-118846: Fix free-threading test failures when run sequentially (#118864)
Sam Gross [Fri, 10 May 2024 20:29:29 +0000 (16:29 -0400)] 
gh-118846: Fix free-threading test failures when run sequentially (#118864)

The free-threaded build currently immortalizes some objects once the
first thread is started. This can lead to test failures depending on the
order in which tests are run. This PR addresses those failures by
suppressing immortalization or skipping the affected tests.

17 months agogh-118702: Implement vectorcall for BaseException (#118703)
Victor Stinner [Fri, 10 May 2024 19:08:24 +0000 (21:08 +0200)] 
gh-118702: Implement vectorcall for BaseException (#118703)

* BaseException_vectorcall() now creates a tuple from 'args' array.
* Creation an exception using BaseException_vectorcall() is now a
  single function call, rather than having to call
  BaseException_new() and then BaseException_init().
  Calling BaseException_init() is inefficient since it overrides
  the 'args' attribute.
* _PyErr_SetKeyError() now uses PyObject_CallOneArg() to create the
  KeyError instance to use BaseException_vectorcall().

17 months agoRename typing._collect_parameters (#118900)
Jelle Zijlstra [Fri, 10 May 2024 16:55:49 +0000 (09:55 -0700)] 
Rename typing._collect_parameters (#118900)

Unfortunately, released versions of typing_extensions
monkeypatch this function without the extra parameter, which makes
it so things break badly if current main is used with typing_extensions.

Fortunately, the monkeypatching is not needed on Python 3.13, because CPython
now implements PEP 696. By renaming the function, we prevent the monkeypatch
from breaking typing.py internals.

We keep the old name (raising a DeprecationWarning) to help other external users who call it.

17 months agoGH-118910: Less boilerplate in the tier 2 optimizer (#118913)
Mark Shannon [Fri, 10 May 2024 16:43:23 +0000 (17:43 +0100)] 
GH-118910: Less boilerplate in the tier 2 optimizer (#118913)

17 months agogh-118771: Ensure names defined in optimizer.h start with Py/_Py (GH-118825)
Petr Viktorin [Fri, 10 May 2024 16:20:12 +0000 (18:20 +0200)] 
gh-118771: Ensure names defined in optimizer.h start with Py/_Py (GH-118825)

17 months agoGH-78707: Drop deprecated `pathlib.PurePath.[is_]relative_to()` arguments (#118780)
Barney Gale [Fri, 10 May 2024 15:53:46 +0000 (16:53 +0100)] 
GH-78707: Drop deprecated `pathlib.PurePath.[is_]relative_to()` arguments (#118780)

Remove support for supplying additional positional arguments to
`PurePath.relative_to()` and `is_relative_to()`. This has been deprecated
since Python 3.12.

17 months agogh-118895: Call PyType_Ready() on typing.NoDefault (#118897)
Jelle Zijlstra [Fri, 10 May 2024 15:42:00 +0000 (08:42 -0700)] 
gh-118895: Call PyType_Ready() on typing.NoDefault (#118897)

17 months agoCorrect the argument names for `secrets.choice` and `secrets.randbelow` in `secrets...
Adam Dangoor [Fri, 10 May 2024 14:30:42 +0000 (15:30 +0100)] 
Correct the argument names for `secrets.choice` and `secrets.randbelow` in `secrets.rst` (GH-118098)

Correct the argument names for `secrets.choice` and `secrets.randbelow` in `secrets.rst`.

17 months agogh-117657: Fix QSBR race condition (#118843)
Alex Turner [Fri, 10 May 2024 14:26:35 +0000 (15:26 +0100)] 
gh-117657: Fix QSBR race condition (#118843)

`_Py_qsbr_unregister` is called when the PyThreadState is already
detached, so the access to `tstate->qsbr` isn't safe without locking the
shared mutex. Grab the `struct _qsbr_shared` from the interpreter
instead.

17 months agogh-117657: Fix data races reported by TSAN on `interp->threads.main` (#118865)
mpage [Fri, 10 May 2024 13:59:14 +0000 (06:59 -0700)] 
gh-117657: Fix data races reported by TSAN on `interp->threads.main` (#118865)

Use relaxed loads/stores when reading/writing to this field.

17 months agogh-118789: Restore hidden `_PyWeakref_ClearRef` (#118797)
Sam Gross [Fri, 10 May 2024 13:54:18 +0000 (09:54 -0400)] 
gh-118789: Restore hidden `_PyWeakref_ClearRef` (#118797)

_PyWeakref_ClearRef was previously exposed in the public C-API, although
it begins with an underscore and is not documented. It's used by a few
C-API extensions. There is currently no alternative public API that can
replace its use.

_PyWeakref_ClearWeakRefsExceptCallbacks is the only thread-safe way to
use _PyWeakref_ClearRef in the free-threaded build. This exposes the C
symbol, but does not make the API public.

17 months agogh-117398: Move types to datetime state (#118606)
Victor Stinner [Fri, 10 May 2024 13:24:06 +0000 (15:24 +0200)] 
gh-117398: Move types to datetime state (#118606)

Move types to the datetime_state structure of the _datetime
extension.

17 months agoRename `notimplemented_methods` into `nodefault_methods` (#118896)
Nikita Sobolev [Fri, 10 May 2024 12:46:20 +0000 (15:46 +0300)] 
Rename `notimplemented_methods` into `nodefault_methods` (#118896)

17 months agogh-118689: Doc: fix ePub build (#118690)
Inada Naoki [Fri, 10 May 2024 10:24:02 +0000 (19:24 +0900)] 
gh-118689: Doc: fix ePub build (#118690)

17 months agogh-117873: Use positional-only parameters in _posixshmem (#118012)
Victor Stinner [Fri, 10 May 2024 10:04:16 +0000 (12:04 +0200)] 
gh-117873: Use positional-only parameters in _posixshmem (#118012)

* shm_unlink() parameter becomes positional-only.
* shm_open() first parameter (path) becomes positional-only,
  the two following parameters remain positional-or-keyword.

17 months agogh-118209: Add Windows structured exception handling to mmap module (GH-118213)
Dobatymo [Fri, 10 May 2024 09:47:30 +0000 (17:47 +0800)] 
gh-118209: Add Windows structured exception handling to mmap module (GH-118213)

17 months agoFix some missing null checks. (GH-118721)
Steve Dower [Fri, 10 May 2024 09:31:55 +0000 (10:31 +0100)] 
Fix some missing null checks. (GH-118721)

17 months agoDocs: fix typos in documentation (GH-118815)
Xie Yanbo [Fri, 10 May 2024 08:11:50 +0000 (16:11 +0800)] 
Docs: fix typos in documentation (GH-118815)

18 months agoRevert "gh-115432: Add critical section variant that handles a NULL object (#115433...
Sam Gross [Thu, 9 May 2024 22:33:53 +0000 (18:33 -0400)] 
Revert "gh-115432: Add critical section variant that handles a NULL object (#115433)" (#118861)

This reverts commit ad4f909e0e7890e027c4ae7fea74586667242ad3.

The API ended up not being used.

18 months agogh-118851: Default ctx arguments to AST constructors to Load() (#118854)
Jelle Zijlstra [Thu, 9 May 2024 22:30:14 +0000 (15:30 -0700)] 
gh-118851: Default ctx arguments to AST constructors to Load() (#118854)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
18 months agogh-117657: Replace TSAN suppresions with more specific rules (#118722)
Brett Simmers [Thu, 9 May 2024 21:02:39 +0000 (14:02 -0700)] 
gh-117657: Replace TSAN suppresions with more specific rules (#118722)

Using `race:` filters out warnings if the function appears anywhere in
the stack trace. This can hide a lot of unrelated warnings, especially
for a function like `_PyEval_EvalFrameDefault`, which is somewhere on
the stack more often than not.

Change all free-threaded suppressions to `race_top:`, which only matches
the top frame, and add any new suppressions this exposes.

18 months agogh-118846: Fix PGO tests in free-threaded build (#118862)
Sam Gross [Thu, 9 May 2024 20:06:20 +0000 (16:06 -0400)] 
gh-118846: Fix PGO tests in free-threaded build (#118862)

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

This fixes test_ordered_dict and test_struct.

18 months agogh-116984: Make mimalloc header includes relative to the current file (#118808)
Sam Gross [Thu, 9 May 2024 20:03:45 +0000 (16:03 -0400)] 
gh-116984: Make mimalloc header includes relative to the current file (#118808)

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.

18 months agogh-118561: Fix crash involving list.extend in free-threaded build (#118723)
Sam Gross [Thu, 9 May 2024 18:52:27 +0000 (14:52 -0400)] 
gh-118561: Fix crash involving list.extend in free-threaded build (#118723)

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.

18 months agogh-118849: Fix "code will never be executed" warning in `dictobject.c` (#118850)
Nikita Sobolev [Thu, 9 May 2024 17:15:14 +0000 (20:15 +0300)] 
gh-118849: Fix "code will never be executed" warning in `dictobject.c` (#118850)

18 months agogh-118773: Use language-invariant SDDL string instead of aliases for ACLs. (GH-118800)
Steve Dower [Thu, 9 May 2024 16:43:21 +0000 (17:43 +0100)] 
gh-118773: Use language-invariant SDDL string instead of aliases for ACLs. (GH-118800)

18 months agogh-117657: Acquire a critical section around `SemLock.__{enter,exit}__` (#118812)
mpage [Thu, 9 May 2024 16:05:52 +0000 (09:05 -0700)] 
gh-117657: Acquire a critical section around `SemLock.__{enter,exit}__` (#118812)

These methods are purely wrappers around `Semlock.{acquire,release}`,
which expect a critical section to be held.

18 months agogh-118817: Fix `asyncio REPL` on Windows (#118819)
Kirill Podoprigora [Thu, 9 May 2024 15:20:46 +0000 (18:20 +0300)] 
gh-118817: Fix `asyncio REPL` on Windows (#118819)

18 months agogh-118767: Improve tests and docs for bool(NotImplemented) (#118813) 118842/head
Jelle Zijlstra [Thu, 9 May 2024 13:52:08 +0000 (06:52 -0700)] 
gh-118767: Improve tests and docs for bool(NotImplemented) (#118813)

18 months agogh-118802: Fix ACL use in test for non-English Windows (GH-118831)
Steve Dower [Thu, 9 May 2024 12:59:18 +0000 (13:59 +0100)] 
gh-118802: Fix ACL use in test for non-English Windows (GH-118831)

18 months agogh-103956: Fix `trace` output in case of missing source line (GH-103958)
Radislav Chugunov [Thu, 9 May 2024 12:09:44 +0000 (15:09 +0300)] 
gh-103956: Fix `trace` output in case of missing source line (GH-103958)

Print only filename with lineno if linecache.getline() returns an empty string.

18 months agogh-118805: Remove type, choices, metavar params of `BooleanOptionalAction` (#118806)
Nikita Sobolev [Thu, 9 May 2024 11:46:45 +0000 (14:46 +0300)] 
gh-118805: Remove type, choices, metavar params of `BooleanOptionalAction` (#118806)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
18 months agogh-118798: Remove deprecated isdst parameter from `email.utils.localtime` (#118799)
Hugo van Kemenade [Thu, 9 May 2024 09:17:02 +0000 (12:17 +0300)] 
gh-118798: Remove deprecated isdst parameter from `email.utils.localtime` (#118799)

18 months agogh-118033: Fix `__weakref__` not set for generic dataclasses (#118099)
Nikita Sobolev [Thu, 9 May 2024 08:36:17 +0000 (11:36 +0300)] 
gh-118033: Fix `__weakref__` not set for generic dataclasses (#118099)

18 months agoGH-101588: Remove deprecated pickle/copy/deepcopy from itertools (gh-118816)
Raymond Hettinger [Thu, 9 May 2024 08:31:47 +0000 (03:31 -0500)] 
GH-101588: Remove deprecated pickle/copy/deepcopy from itertools (gh-118816)

18 months ago[tests]: Mark ``test_statistics.test_kde_random`` with a ``requires_resource('cpu...
Kirill Podoprigora [Thu, 9 May 2024 08:16:37 +0000 (11:16 +0300)] 
[tests]: Mark ``test_statistics.test_kde_random`` with a ``requires_resource('cpu')`` decorator (#118801)

Mark test_kde_random with a requires_resource('cpu') decorator

18 months agogh-118803: Remove `ByteString` from `typing` and `collections.abc` (#118804)
Nikita Sobolev [Wed, 8 May 2024 23:37:55 +0000 (02:37 +0300)] 
gh-118803: Remove `ByteString` from `typing` and `collections.abc` (#118804)

18 months agogh-117657: Fix data races when writing / reading `ob_gc_bits` (#118292)
mpage [Wed, 8 May 2024 20:03:39 +0000 (13:03 -0700)] 
gh-117657: Fix data races when writing / reading `ob_gc_bits` (#118292)

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.

18 months agoFixing a typo in test_cmd_line.py (#118728)
Yutian Li [Wed, 8 May 2024 19:58:48 +0000 (15:58 -0400)] 
Fixing a typo in test_cmd_line.py (#118728)

18 months agoFormat None, True, False and NotImplemented as literals (GH-118758)
Serhiy Storchaka [Wed, 8 May 2024 19:35:16 +0000 (22:35 +0300)] 
Format None, True, False and NotImplemented as literals (GH-118758)

18 months agodocs: module page titles should not start with a link to themselves (#117099)
Ned Batchelder [Wed, 8 May 2024 19:34:40 +0000 (15:34 -0400)] 
docs: module page titles should not start with a link to themselves (#117099)

18 months agoDocs: fix typos in documentation (#118752)
Xie Yanbo [Wed, 8 May 2024 18:20:40 +0000 (02:20 +0800)] 
Docs: fix typos in documentation (#118752)

18 months agoRun CI on the 3.13 branch (#118779)
Jelle Zijlstra [Wed, 8 May 2024 18:12:36 +0000 (11:12 -0700)] 
Run CI on the 3.13 branch (#118779)

18 months agogh-118767: Make bool(NotImplemented) raise TypeError (#118775)
Jelle Zijlstra [Wed, 8 May 2024 18:12:00 +0000 (11:12 -0700)] 
gh-118767: Make bool(NotImplemented) raise TypeError (#118775)

18 months agogh-118772: Allow TypeVars without a default to follow those with a default when const...
Jelle Zijlstra [Wed, 8 May 2024 16:54:51 +0000 (09:54 -0700)] 
gh-118772: Allow TypeVars without a default to follow those with a default when constructing aliases (#118774)

18 months agoFix file extensions for 3.14 Whats New (#118770)
Jelle Zijlstra [Wed, 8 May 2024 16:40:40 +0000 (09:40 -0700)] 
Fix file extensions for 3.14 Whats New (#118770)

18 months agoUpdate Windows library names for the Python version bump (#118766)
Kirill Podoprigora [Wed, 8 May 2024 16:00:38 +0000 (19:00 +0300)] 
Update Windows library names for the Python version bump (#118766)

18 months agogh-118486: Update docs for CVE-2024-4030 reference (GH-118737)
Steve Dower [Wed, 8 May 2024 15:52:39 +0000 (16:52 +0100)] 
gh-118486: Update docs for CVE-2024-4030 reference (GH-118737)

18 months agoRegenerate configure for 3.14, which the release script forgot. (#118765)
T. Wouters [Wed, 8 May 2024 15:29:50 +0000 (17:29 +0200)] 
Regenerate configure for 3.14, which the release script forgot. (#118765)

18 months agoPython 3.14.0a0
Thomas Wouters [Wed, 8 May 2024 14:57:05 +0000 (16:57 +0200)] 
Python 3.14.0a0

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.