]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
17 months ago[3.13] gh-89928: Fix integer conversion of device numbers (GH-31794) (GH-120053)
Miss Islington (bot) [Tue, 4 Jun 2024 17:19:13 +0000 (19:19 +0200)] 
[3.13] gh-89928: Fix integer conversion of device numbers (GH-31794) (GH-120053)

Fix os.major(), os.minor() and os.makedev().
Support device numbers larger than 2**63-1.
Support non-existent device number (NODEV).
(cherry picked from commit 7111d9605f9db7aa0b095bb8ece7ccc0b8115c3f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
17 months ago[3.13] Fix incorrect pull GitHub link in What's New (GH-120045) (#120052)
Miss Islington (bot) [Tue, 4 Jun 2024 17:06:14 +0000 (19:06 +0200)] 
[3.13] Fix incorrect pull GitHub link in What's New (GH-120045) (#120052)

Co-authored-by: Trey Hunner <trey@treyhunner.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
17 months ago[3.13] gh-119588: Update docs to reflect decision to include the change with Python...
Miss Islington (bot) [Tue, 4 Jun 2024 15:39:49 +0000 (17:39 +0200)] 
[3.13] gh-119588: Update docs to reflect decision to include the change with Python 3.13 and not 3.12. (GH-120043) (#120046)

gh-119588: Update docs to reflect decision to include the change with Python 3.13 and not 3.12. (GH-120043)
(cherry picked from commit 4dcd91ceafce91ec37bb1a9d544e41fc65578994)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
17 months ago[3.13] gh-119588: Implement zipfile.Path.is_symlink (zipp 3.19.0). (GH-119591) (...
Miss Islington (bot) [Tue, 4 Jun 2024 14:56:06 +0000 (16:56 +0200)] 
[3.13] gh-119588: Implement zipfile.Path.is_symlink (zipp 3.19.0). (GH-119591) (#119985)

gh-119588: Implement zipfile.Path.is_symlink (zipp 3.19.0). (GH-119591)
(cherry picked from commit 42a34ddb0b63e638905b01e17a7254623a0de427)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
17 months ago[3.13] gh-106531: Apply changes from importlib_resources 6.3.2 (GH-117054) (#120014)
Miss Islington (bot) [Tue, 4 Jun 2024 14:54:59 +0000 (16:54 +0200)] 
[3.13] gh-106531: Apply changes from importlib_resources 6.3.2 (GH-117054) (#120014)

gh-106531: Apply changes from importlib_resources 6.3.2 (GH-117054)

Apply changes from importlib_resources 6.3.2.
(cherry picked from commit 8d63c8d47b9edd8ac2f0b395b2fa0ae5f571252d)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
17 months ago[3.13] gh-117657: Fix race involving GC and heap initialization (GH-119923) (#120038)
Miss Islington (bot) [Tue, 4 Jun 2024 14:08:10 +0000 (16:08 +0200)] 
[3.13] gh-117657: Fix race involving GC and heap initialization (GH-119923) (#120038)

The `_PyThreadState_Bind()` function is called before the first
`PyEval_AcquireThread()` so it's not synchronized with the stop the
world GC. We had a race where `gc_visit_heaps()` might visit a thread's
heap while it's being initialized.

Use a simple atomic int to avoid visiting heaps for threads that are not
yet fully initialized (i.e., before `tstate_mimalloc_bind()` is called).

The race was reproducible by running:
`python Lib/test/test_importlib/partial/pool_in_threads.py`.
(cherry picked from commit e69d068ad0bd6a25434ea476a647b635da4d82bb)

Co-authored-by: Sam Gross <colesbury@gmail.com>
17 months ago[3.13] gh-119819: Fix regression to allow logging configuration with multipr… (GH...
Miss Islington (bot) [Tue, 4 Jun 2024 12:46:41 +0000 (14:46 +0200)] 
[3.13] gh-119819: Fix regression to allow logging configuration with multipr… (GH-120030) (GH-120035)

(cherry picked from commit 99d945c0c006e3246ac00338e37c443c6e08fc5c)

17 months ago[3.13] gh-118868: logging QueueHandler fix passing of kwargs (GH-118869) (GH-120032)
Miss Islington (bot) [Tue, 4 Jun 2024 12:18:11 +0000 (14:18 +0200)] 
[3.13] gh-118868: logging QueueHandler fix passing of kwargs (GH-118869) (GH-120032)

(cherry picked from commit dce14bb2dce7887df40ae5c13b0d13e0dafceff7)

17 months ago[3.13] gh-119070: Update test_shebang_executable_extension to always use non-installe...
Miss Islington (bot) [Tue, 4 Jun 2024 11:24:10 +0000 (13:24 +0200)] 
[3.13] gh-119070: Update test_shebang_executable_extension to always use non-installed version (GH-119846) (#GH-120015)

gh-119070: Update test_shebang_executable_extension to always use non-installed version (GH-119846)
(cherry picked from commit 5c48eb0cc6c3e84aafda0a734a05ecec14fc0ccf)

Co-authored-by: Steve Dower <steve.dower@python.org>
17 months ago[3.13] gh-111499: Fix PYTHONMALLOCSTATS at Python exit (GH-120021) (#120022)
Miss Islington (bot) [Tue, 4 Jun 2024 10:02:12 +0000 (12:02 +0200)] 
[3.13] gh-111499: Fix PYTHONMALLOCSTATS at Python exit (GH-120021) (#120022)

gh-111499: Fix PYTHONMALLOCSTATS at Python exit (GH-120021)

Call _PyObject_DebugMallocStats() earlier in Py_FinalizeEx(), before
the interpreter is deleted.
(cherry picked from commit 5a1205b641df133932ed4c65b9a4ff5724e89963)

Co-authored-by: Victor Stinner <vstinner@python.org>
17 months ago[3.13] gh-111389: Add PyHASH_MULTIPLIER constant (GH-119214) (#119334)
Miss Islington (bot) [Tue, 4 Jun 2024 07:26:25 +0000 (09:26 +0200)] 
[3.13] gh-111389: Add PyHASH_MULTIPLIER constant (GH-119214) (#119334)

gh-111389: Add PyHASH_MULTIPLIER constant (GH-119214)
(cherry picked from commit f6da790122fdae1a28f444edfbb55202d6829cd1)

Co-authored-by: Victor Stinner <vstinner@python.org>
17 months ago[3.13] gh-119724: Revert "bpo-45759: Better error messages for non-matching 'elif...
T. Wouters [Tue, 4 Jun 2024 06:36:16 +0000 (23:36 -0700)] 
[3.13] gh-119724: Revert "bpo-45759: Better error messages for non-matching 'elif'/'else' statements (GH-29513)" (GH-119974) (GH-120013)

This reverts commit 1c8f912ebdfdb146cd7dd2d7a3a67d2c5045ddb0.
(cherry picked from commit 31a4fb3c74a0284436343858803b54471e2dc9c7)

17 months ago[3.13] gh-117398: Use Per-Interpreter State for the _datetime Static Types (gh-120009)
Miss Islington (bot) [Mon, 3 Jun 2024 23:37:28 +0000 (01:37 +0200)] 
[3.13] gh-117398: Use Per-Interpreter State for the _datetime Static Types (gh-120009)

We make use of the same mechanism that we use for the static builtin types.  This required a few tweaks.

This change is the final piece needed to make _datetime support multiple interpreters.  I've updated the module slot accordingly.

(cherry picked from commit 105f22ea46ac16866e6df18ebae2a8ba422b7f45, AKA gh-119929)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
17 months ago[3.13] gh-117142: Support Importing ctypes in Isolated Interpreters (gh-120008)
Miss Islington (bot) [Mon, 3 Jun 2024 23:06:56 +0000 (01:06 +0200)] 
[3.13] gh-117142: Support Importing ctypes in Isolated Interpreters (gh-120008)

This makes the support official.

(cherry picked from commit dba7a167dbbd50e83e58df351f3414b7a08e0188, AKA gh-119991)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
17 months ago[3.13] gh-117398: Add datetime Module State (gh-120004)
Miss Islington (bot) [Mon, 3 Jun 2024 23:05:04 +0000 (01:05 +0200)] 
[3.13] gh-117398: Add datetime Module State (gh-120004)

I was able to make use of the existing datetime_state struct, but there was one tricky thing I had to sort out.  We mostly aren't converting to heap types, so we can't use things like PyType_GetModuleByDef() to look up the module state.  The solution I came up with is somewhat novel, but I consider it straightforward.  Also, it shouldn't have much impact on performance.

In summary, this main changes here are:

* I've added some macros to help hide how various objects relate to module state
* as a solution to the module state lookup problem, I've stored the last loaded module on the current interpreter's internal dict (actually a weakref)
* if the static type method is used after the module has been deleted, it is reloaded
* to avoid extra work when loading the module, we directly copy the objects (new refs only) from the old module state into the new state if the old module hasn't been deleted yet
* during module init we set various objects on the static types' __dict__s; to simplify things, we only do that the first time; once those static types have a separate __dict__ per interpreter, we'll do it every time
* we now clear the module state when the module is destroyed (before, we were leaking everything in _datetime_global_state)

(cherry picked from commit d82a7ba041321e7b58a5a9bbc394670be6ceeb7c, AKA gh-119810)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
17 months ago[3.13] gh-117657: Fix itertools.count thread safety (GH-119268) (#120007)
Sam Gross [Mon, 3 Jun 2024 22:47:34 +0000 (18:47 -0400)] 
[3.13] gh-117657: Fix itertools.count thread safety (GH-119268) (#120007)

Fix itertools.count in free-threading mode
(cherry picked from commit 87939bd5790accea77c5a81093f16f28d3f0b429)

Co-authored-by: Arnon Yaari <wiggin15@yahoo.com>
17 months ago[3.13] gh-117657: Fix race involving immortalizing objects (GH-119927) (#120005)
Sam Gross [Mon, 3 Jun 2024 22:21:32 +0000 (18:21 -0400)] 
[3.13] gh-117657: Fix race involving immortalizing objects (GH-119927) (#120005)

The free-threaded build currently immortalizes objects that use deferred
reference counting (see gh-117783). This typically happens once the
first non-main thread is created, but the behavior can be suppressed for
tests, in subinterpreters, or during a compile() call.

This fixes a race condition involving the tracking of whether the
behavior is suppressed.

(cherry picked from commit 47fb4327b5c405da6df066dcaa01b7c1aefab313)

17 months ago[3.13] gh-117657: Avoid `sem_clockwait` in TSAN (GH-119915) (#119992)
Miss Islington (bot) [Mon, 3 Jun 2024 18:07:22 +0000 (20:07 +0200)] 
[3.13] gh-117657: Avoid `sem_clockwait` in TSAN (GH-119915) (#119992)

The `sem_clockwait` function is not currently instrumented, which leads
to false positives.
(cherry picked from commit 41c1cefbae71d687d1a935233b086473df65e15c)

Co-authored-by: Sam Gross <colesbury@gmail.com>
17 months ago[3.13] gh-118835: pyrepl: Fix prompt length computation for custom prompts containing...
Miss Islington (bot) [Mon, 3 Jun 2024 17:31:26 +0000 (19:31 +0200)] 
[3.13] gh-118835: pyrepl: Fix prompt length computation for custom prompts containing ANSI escape codes (GH-119942) (#119990)

gh-118835: pyrepl: Fix prompt length computation for custom prompts containing ANSI escape codes (GH-119942)
(cherry picked from commit 2e0aa731aebb8ef3d89ada82f5d39b1bbac65d1f)

Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
17 months ago[3.13] Use Cirrus M1 macOS runners for CI (GH-119979) (GH-119986)
Miss Islington (bot) [Mon, 3 Jun 2024 16:15:37 +0000 (18:15 +0200)] 
[3.13] Use Cirrus M1 macOS runners for CI (GH-119979) (GH-119986)

(cherry picked from commit 6acb32fac3511c1d5500cac66f1d6397dcdab835)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Ee Durbin <ee@python.org>
17 months agogh-119679: Ensures correct import libraries are included in Windows install packages...
Miss Islington (bot) [Mon, 3 Jun 2024 15:06:53 +0000 (17:06 +0200)] 
gh-119679: Ensures correct import libraries are included in Windows install packages (GH-119790)

(cherry picked from commit fd01271366abefa8f991e53f090387882fbd6bdd)

Co-authored-by: Steve Dower <steve.dower@python.org>
17 months agogh-102511: Amend 3.13.0b1.rst (GH-119895)
Miss Islington (bot) [Mon, 3 Jun 2024 13:46:40 +0000 (15:46 +0200)] 
gh-102511: Amend 3.13.0b1.rst (GH-119895)

(cherry picked from commit 4765e1fa292007f8ddc59f33454b747312506a7a)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
17 months ago[3.13] gh-119968: Improved monitoring c-api docs (GH-119969) (#119971)
Miss Islington (bot) [Mon, 3 Jun 2024 09:49:14 +0000 (11:49 +0200)] 
[3.13] gh-119968: Improved monitoring c-api docs (GH-119969) (#119971)

gh-119968: Improved monitoring c-api docs (GH-119969)
(cherry picked from commit cae4c80714e7266772025676977e2a1b98cdcd7b)

Co-authored-by: Awbert <119314310+SweetyAngel@users.noreply.github.com>
17 months ago[3.13] gh-119336: Restore removed _PyLong_NumBits() function (GH-119418) (#119970)
Miss Islington (bot) [Mon, 3 Jun 2024 09:29:07 +0000 (11:29 +0200)] 
[3.13] gh-119336: Restore removed _PyLong_NumBits() function (GH-119418) (#119970)

gh-119336: Restore removed _PyLong_NumBits() function (GH-119418)

It is used by the pywin32 project.
(cherry picked from commit e50fac96e82d857ecc024b4cd4e012493b077064)

Co-authored-by: Ethan Smith <ethan@ethanhs.me>
17 months ago[3.13] gh-119856: Support exiting help() with just "exit" (GH-119858) (#119967)
Miss Islington (bot) [Mon, 3 Jun 2024 09:10:39 +0000 (11:10 +0200)] 
[3.13] gh-119856: Support exiting help() with just "exit" (GH-119858) (#119967)

gh-119856: Support exiting help() with just "exit" (GH-119858)
(cherry picked from commit 4223f1d828d3a3e1c8d803e3fdd420afd7d85faf)

Co-authored-by: Victor Stinner <vstinner@python.org>
17 months ago[3.13] gh-117657: Fix data races report by TSAN unicode-hash (gh-119907) (gh-119963)
Miss Islington (bot) [Mon, 3 Jun 2024 03:45:44 +0000 (05:45 +0200)] 
[3.13] gh-117657: Fix data races report by TSAN unicode-hash (gh-119907) (gh-119963)

gh-117657: Fix data races report by TSAN unicode-hash (gh-119907)
(cherry picked from commit 0594a27e5f1d87d59fa8a761dd8ca9df4e42816d)

Co-authored-by: Donghee Na <donghee.na@python.org>
17 months ago[3.13] gh-109975: What's New in Python 3.13: fix broken link for `telnetlib` alternat...
Miss Islington (bot) [Mon, 3 Jun 2024 00:59:41 +0000 (02:59 +0200)] 
[3.13] gh-109975: What's New in Python 3.13: fix broken link for `telnetlib` alternative (GH-119958) (#119959)

(cherry picked from commit 117a8acdab997b73ada822cce97815a86f839e15)

Co-authored-by: Solomon Himelbloom <7608183+TechSolomon@users.noreply.github.com>
17 months ago[3.13] GH-119054: Add "Reading and writing files" section to pathlib docs (GH-119524...
Miss Islington (bot) [Sun, 2 Jun 2024 19:58:41 +0000 (21:58 +0200)] 
[3.13] GH-119054: Add "Reading and writing files" section to pathlib docs (GH-119524) (#119954)

Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.

(cherry picked from commit bd6d4ed6454378e48dab06f50a9be0bae6baa3a2)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
17 months ago[3.13] GH-119054: Add "Querying file type and status" section to pathlib docs (GH...
Barney Gale [Sun, 2 Jun 2024 19:37:01 +0000 (20:37 +0100)] 
[3.13] GH-119054: Add "Querying file type and status" section to pathlib docs (GH-119055) (#119951)

Add a dedicated subsection for `Path.stat()`-related methods, specifically
`stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`.

(cherry picked from commit 81d63362302187e5cb838c9a7cd857181142e530)

17 months ago[3.13] Improve documentation for typing.get_type_hints (GH-119928) (#119943)
Miss Islington (bot) [Sun, 2 Jun 2024 15:29:25 +0000 (17:29 +0200)] 
[3.13] Improve documentation for typing.get_type_hints (GH-119928) (#119943)

- Explicit list of what it does that is different from
  "just return __annotations__"
- Remove reference to PEP 563; adding the future import doesn't
  do anything to type aliases, and in general it will never make
  get_type_hints() less likely to fail.
- Remove example, as the Annotated docs already have a similar
  example, and it's unbalanced to have one example about this
  one edge case but not about other behaviors of the function.

(cherry picked from commit aa9fe98e0649f0a151942914ef4e2810ca6126c2)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
17 months ago[3.13] gh-117657: Fix TSAN reported race in `_PyEval_IsGILEnabled`. (GH-119921) ...
Miss Islington (bot) [Sun, 2 Jun 2024 14:42:46 +0000 (16:42 +0200)] 
[3.13] gh-117657: Fix TSAN reported race in `_PyEval_IsGILEnabled`. (GH-119921) (#119939)

The GIL may be disabled concurrently with this call so we need to use a
relaxed atomic load.
(cherry picked from commit f3b89a63cbb6d46e5ed40d5cd9813cdf9189ce35)

Co-authored-by: Sam Gross <colesbury@gmail.com>
17 months ago[3.13] gh-118934: Fix PyEval_GetLocals docs (PEP 667) (GH-119934)
Miss Islington (bot) [Sun, 2 Jun 2024 05:57:17 +0000 (07:57 +0200)] 
[3.13] gh-118934: Fix PyEval_GetLocals docs (PEP 667) (GH-119934)

PEP 667's description of the planned changes to PyEval_GetLocals
was internally inconsistent when accepted, so the docs added for
gh-74929 didn't match either the current behaviour or the intended
behaviour once gh-118934 is fixed.

This PR updates the documentation and 3.13 What's New to match the
intended behaviour (once gh-118934 is fixed).

It also tidies up lingering references to `f_locals` always being a
dictionary (this hasn't been true since at least when custom
namespace support for class statement execution was added)
(cherry picked from commit fd6cd621e0cce6ba2e737103d2a62b5ade90f41f)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
17 months ago[3.13] gh-118888: Further PEP 667 docs updates (gh-119894)
Miss Islington (bot) [Sun, 2 Jun 2024 05:41:25 +0000 (07:41 +0200)] 
[3.13] gh-118888: Further PEP 667 docs updates (gh-119894)

* Clarify impact on default behaviour of exec, eval, etc
* Update documentation for changes to PyEval_GetLocals (gh-74929)

Closes gh-118888
(cherry picked from commit 2180991ea3d50f56595edae241cc92dd4e7de642)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
17 months ago[3.13] gh-119016: Remove outdated sentences from the "classes" tutorial (GH-119130...
Miss Islington (bot) [Sat, 1 Jun 2024 21:35:03 +0000 (23:35 +0200)] 
[3.13] gh-119016: Remove outdated sentences from the "classes" tutorial (GH-119130) (#119925)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
17 months ago[3.13] gh-111201: Skip pyrepl Windows tests earlier (#119848) (#119924)
Victor Stinner [Sat, 1 Jun 2024 21:21:13 +0000 (23:21 +0200)] 
[3.13] gh-111201: Skip pyrepl Windows tests earlier (#119848) (#119924)

gh-111201: Skip pyrepl Windows tests earlier (#119848)

Don't attempt to load pyrepl Windows console if platforms others than
Windows. For example, the import can fail if ctypes is missing.

(cherry picked from commit 91601a55964fdb3c02b21fa3c8dc629daff2390f)

17 months ago[3.13] GH-89727: Fix `shutil.rmtree()` recursion error on deep trees (GH-119808)...
Miss Islington (bot) [Sat, 1 Jun 2024 19:38:55 +0000 (21:38 +0200)] 
[3.13] GH-89727: Fix `shutil.rmtree()` recursion error on deep trees (GH-119808) (#119918)

Implement `shutil._rmtree_safe_fd()` using a list as a stack to avoid emitting recursion errors on deeply nested trees.

`shutil._rmtree_unsafe()` was fixed in a150679f90.

(cherry picked from commit 53b1981fb0cda6c656069e992f172fc6aad7c99c)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
17 months ago[3.13] Add unique() recipe to itertools docs (gh-119911) (gh-119916)
Miss Islington (bot) [Sat, 1 Jun 2024 17:06:04 +0000 (19:06 +0200)] 
[3.13] Add unique() recipe to itertools docs (gh-119911) (gh-119916)

17 months ago[3.13] gh-117657: Add TSAN suppression for `set_discard_entry` (GH-119908) (#119914)
Miss Islington (bot) [Sat, 1 Jun 2024 16:42:16 +0000 (18:42 +0200)] 
[3.13] gh-117657: Add TSAN suppression for `set_discard_entry` (GH-119908) (#119914)

Seen in CI occasionally when running `test_weakref`.
(cherry picked from commit 7dc745d1f5d9558047a52cad5e01df7567533269)

Co-authored-by: Sam Gross <colesbury@gmail.com>
17 months ago[3.13] gh-113892: Add a extra check to `ProactorEventLoop.sock_connect` to ensure...
Miss Islington (bot) [Sat, 1 Jun 2024 16:27:54 +0000 (18:27 +0200)] 
[3.13] gh-113892: Add a extra check to `ProactorEventLoop.sock_connect` to ensure that the given socket is in non-blocking mode (GH-119519) (#119912)

(cherry picked from commit cf3bba3f0671d2c9fee099e3ab0f78b98b176131)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
17 months ago[3.13] Revert "[3.13] gh-69214: Fix fcntl.ioctl() request type (GH-119498) (… (#119906)
Victor Stinner [Sat, 1 Jun 2024 15:08:23 +0000 (17:08 +0200)] 
[3.13] Revert "[3.13] gh-69214: Fix fcntl.ioctl() request type (GH-119498) (… (#119906)

Revert "[3.13] gh-69214: Fix fcntl.ioctl() request type (GH-119498) (#119504)"

This reverts commit 0bab0b3a53da735838720f96f3d3bf86ca6ba125.

The change modified how negative values, like termios.TIOCSWINSZ, was
treated and is actually backward incompatible.

17 months ago[3.13] gh-117657: Fix TSAN race in QSBR assertion (GH-119887) (#119904)
Miss Islington (bot) [Sat, 1 Jun 2024 14:51:55 +0000 (16:51 +0200)] 
[3.13] gh-117657: Fix TSAN race in QSBR assertion (GH-119887) (#119904)

Due to a limitation in TSAN, all reads from `PyThreadState.state` must be
atomic to avoid reported races.
(cherry picked from commit 90ec19fd33e2452902b9788d4821f1fbf6542304)

Co-authored-by: Sam Gross <colesbury@gmail.com>
17 months ago[3.13] gh-117657: Fix TSAN race in free-threaded GC (GH-119883) (#119903)
Miss Islington (bot) [Sat, 1 Jun 2024 14:26:12 +0000 (16:26 +0200)] 
[3.13] gh-117657: Fix TSAN race in free-threaded GC (GH-119883) (#119903)

Only call `gc_restore_tid()` from stop-the-world contexts.
`worklist_pop()` can be called while other threads are running, so use a
relaxed atomic to modify `ob_tid`.
(cherry picked from commit 60593b2052ca275559c11028d50e19f8e5dfee13)

Co-authored-by: Sam Gross <colesbury@gmail.com>
17 months ago[3.13] gh-119821: Support non-dict globals in LOAD_FROM_DICT_OR_GLOBALS (#119822...
Jelle Zijlstra [Sat, 1 Jun 2024 04:56:26 +0000 (21:56 -0700)] 
[3.13] gh-119821: Support non-dict globals in LOAD_FROM_DICT_OR_GLOBALS (#119822) (#119889)

dSupport non-dict globals in LOAD_FROM_DICT_OR_GLOBALS

The implementation basically copies LOAD_GLOBAL. Possibly it could be deduplicated,
but that seems like it may get hairy since the two operations have different operands.

This is important to fix in 3.14 for PEP 649, but it's a bug in earlier versions too,
and we should backport to 3.13 and 3.12 if possible.

(cherry picked from commit 80a4e3899420faaa012c82b4e82cdb6675a6a944)

17 months ago[3.13] gh-74929: PEP 667 C API documentation (gh-119892)
Miss Islington (bot) [Sat, 1 Jun 2024 04:23:04 +0000 (06:23 +0200)] 
[3.13] gh-74929: PEP 667 C API documentation (gh-119892)

* Add docs for new APIs
* Add soft-deprecation notices
* Add What's New porting entries
* Update comments referencing `PyFrame_LocalsToFast()` to mention the proxy instead
* Other related cleanups found when looking for refs to the deprecated APIs

(cherry picked from commit 3859e09e3d92d004978dd838f0511364e7edfb94)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
17 months ago[3.13] gh-118894: Make asyncio REPL use pyrepl (GH-119433) (#119884)
Miss Islington (bot) [Fri, 31 May 2024 21:15:44 +0000 (23:15 +0200)] 
[3.13] gh-118894: Make asyncio REPL use pyrepl (GH-119433) (#119884)

(cherry picked from commit 2237946af0981c46dc7d3886477e425ccfb37f28)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
17 months ago[3.13] gh-119799: Add missing `_Py_IncRefTotal` to `_Py_NewRefWithLock` (GH-119800...
Miss Islington (bot) [Fri, 31 May 2024 19:08:21 +0000 (21:08 +0200)] 
[3.13] gh-119799: Add missing `_Py_IncRefTotal` to `_Py_NewRefWithLock` (GH-119800) (#119878)

The free-threaded refleak builds were reporting negative refcount deltas
in some tests because of a missing `_Py_NewRefWithLock`.
(cherry picked from commit 879d43b705faab0c59f1a6a0042e286f39f3a4ef)

Co-authored-by: Sam Gross <colesbury@gmail.com>
17 months ago[3.13] gh-119369: Fix deadlock during thread exit in free-threaded build (GH-119528...
Miss Islington (bot) [Fri, 31 May 2024 18:19:38 +0000 (20:19 +0200)] 
[3.13] gh-119369: Fix deadlock during thread exit in free-threaded build (GH-119528) (#119868)

Release the GIL before calling `_Py_qsbr_unregister`.

The deadlock could occur when the GIL was enabled at runtime. The
`_Py_qsbr_unregister` call might block while holding the GIL because the
thread state was not active, but the GIL was still held.
(cherry picked from commit 078b8c8cf2bf68f7484cc4d2e3dd74b6fab55664)

Co-authored-by: Sam Gross <colesbury@gmail.com>
17 months ago[3.13] doc: Add glossary entry for "free threading" (GH-119865) (#119874)
Miss Islington (bot) [Fri, 31 May 2024 17:42:36 +0000 (19:42 +0200)] 
[3.13] doc: Add glossary entry for "free threading" (GH-119865) (#119874)

(cherry picked from commit 9bc6045842ebc91ec48ab163a9e1e8644231607c)

Co-authored-by: Sam Gross <colesbury@gmail.com>
17 months ago[3.13] contextlib docs: Clean up redundant 'up' after 'cleanup' (GH-119872)
Miss Islington (bot) [Fri, 31 May 2024 17:39:02 +0000 (19:39 +0200)] 
[3.13] contextlib docs: Clean up redundant 'up' after 'cleanup' (GH-119872)

Reported by Michael Kass on docs@
(cherry picked from commit f3fc800d5f17b144a752a262102b750bedcdaa14)

17 months ago[3.13] gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions...
Miss Islington (bot) [Fri, 31 May 2024 17:27:55 +0000 (19:27 +0200)] 
[3.13] gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions field. (GH-119364) (#119869)

gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions field. (GH-119364)
(cherry picked from commit 015b1fdd0ae03f94a5dfda051b020810d1c952dd)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
17 months agogh-119690: Adds Unicode support for named pipes in _winapi (GH-119717)
Miss Islington (bot) [Fri, 31 May 2024 16:22:30 +0000 (18:22 +0200)] 
gh-119690: Adds Unicode support for named pipes in _winapi (GH-119717)

(cherry picked from commit 78d697b7d5ec2a6fa046b0e1c34e804f49e750b4)

Co-authored-by: Steve Dower <steve.dower@python.org>
17 months ago[3.13] gh-119585: Fix crash involving `PyGILState_Release()` and `PyThreadState_Clear...
Miss Islington (bot) [Fri, 31 May 2024 15:29:50 +0000 (17:29 +0200)] 
[3.13] gh-119585: Fix crash involving `PyGILState_Release()` and `PyThreadState_Clear()` (GH-119753) (#119859)

Make sure that `gilstate_counter` is not zero in when calling
`PyThreadState_Clear()`. A destructor called from `PyThreadState_Clear()` may
call back into `PyGILState_Ensure()` and `PyGILState_Release()`. If
`gilstate_counter` is zero, it will try to create a new thread state before
the current active thread state is destroyed, leading to an assertion failure
or crash.
(cherry picked from commit bcc1be39cb1d04ad9fc0bd1b9193d3972835a57c)

Co-authored-by: Sam Gross <colesbury@gmail.com>
17 months ago[3.13] gh-111201: Support pyrepl on Windows (GH-119559) (GH-119850)
Miss Islington (bot) [Fri, 31 May 2024 15:18:28 +0000 (17:18 +0200)] 
[3.13] gh-111201: Support pyrepl on Windows (GH-119559) (GH-119850)

(cherry picked from commit 0d07182821fad7b95a043d006f1ce13a2d22edcb)

Co-authored-by: Dino Viehland <dinoviehland@gmail.com>
Co-authored-by: Anthony Shaw <anthony.p.shaw@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
17 months agogh-116145: Updated bundled Tcl/Tk on Windows to 8.6.14 (GH-117030)
Miss Islington (bot) [Fri, 31 May 2024 12:38:03 +0000 (14:38 +0200)] 
gh-116145: Updated bundled Tcl/Tk on Windows to 8.6.14 (GH-117030)

(cherry picked from commit 0e8d35b931f41210483cc51c4169e9a943c7f166)

Co-authored-by: Steve Dower <steve.dower@python.org>
17 months ago[3.13] gh-103194: Fix Tkinter’s Tcl value type handling for Tcl 8.7/9.0 (GH-103846...
Miss Islington (bot) [Fri, 31 May 2024 10:42:24 +0000 (12:42 +0200)] 
[3.13] gh-103194: Fix Tkinter’s Tcl value type handling for Tcl 8.7/9.0 (GH-103846) (GH-119830)

Some of standard Tcl types were renamed, removed, or no longer
registered in Tcl 8.7/9.0. This change fixes automatic conversion of Tcl
values to Python values to avoid returning a Tcl_Obj where the primary
Python types (int, bool, str, bytes) were returned in older Tcl.
(cherry picked from commit 94e9585e99abc2d060cedc77b3c03e06b4a0a9c4)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
17 months ago[3.13] gh-111201: Improve pyrepl auto indentation (GH-119606) (GH-119833)
Miss Islington (bot) [Fri, 31 May 2024 09:51:53 +0000 (11:51 +0200)] 
[3.13] gh-111201: Improve pyrepl auto indentation (GH-119606) (GH-119833)

- auto-indent when editing multi-line block
- ignore comments

(cherry picked from commit dae0375bd97f3821c5db1602a0653a3c5dc53c5b)

Co-authored-by: Arnon Yaari <wiggin15@yahoo.com>
17 months ago[3.13] gh-97747: Improvements to WASM browser REPL. (GH-97665) (GH-119828)
Miss Islington (bot) [Fri, 31 May 2024 09:25:39 +0000 (11:25 +0200)] 
[3.13] gh-97747: Improvements to WASM browser REPL. (GH-97665) (GH-119828)

(cherry picked from commit 010aaa32fb93c5033a698d7213469af02d76fef3)

Co-authored-by: Katie Bell <katie@katharos.id.au>
17 months ago[3.13] gh-119548: Add a 'clear' command to the REPL (GH-119549) (#119552)
Miss Islington (bot) [Fri, 31 May 2024 08:35:21 +0000 (10:35 +0200)] 
[3.13] gh-119548: Add a 'clear' command to the REPL (GH-119549) (#119552)

gh-119548: Add a 'clear' command to the REPL (GH-119549)
(cherry picked from commit e3bac04c37f6823cebc74d97feae0e0c25818b31)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
17 months ago[3.13] gh-107262: Update Tkinter tests for Tcl/Tk 8.6.14 (GH-119322) (GH-119806)
Miss Islington (bot) [Thu, 30 May 2024 21:16:35 +0000 (23:16 +0200)] 
[3.13] gh-107262: Update Tkinter tests for Tcl/Tk 8.6.14 (GH-119322) (GH-119806)

(cherry picked from commit 9732ed5ca94cd8fe9ca2fc7ba5a42dfa2b7791ea)

Co-authored-by: James De Bias <81095953+DBJim@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
17 months ago[3.13] Docs: `shutil.rmtree`'s `onerror` has no pending removal version (GH-118947...
Miss Islington (bot) [Thu, 30 May 2024 20:52:43 +0000 (22:52 +0200)] 
[3.13] Docs: `shutil.rmtree`'s `onerror` has no pending removal version (GH-118947) (#119804)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
17 months ago[3.13] gh-109218: Improve documentation for the complex() constructor (GH-119687...
Miss Islington (bot) [Thu, 30 May 2024 20:44:20 +0000 (22:44 +0200)] 
[3.13] gh-109218: Improve documentation for the complex() constructor (GH-119687) (GH-119803)

* Remove the equivalence with real+imag*1j which can be incorrect in corner
  cases (non-finite numbers, the sign of zeroes).
* Separately document the three roles of the constructor: parsing a string,
  converting a number, and constructing a complex from components.
* Document positional-only parameters of complex(), float(), int() and bool()
  as positional-only.
* Add examples for complex() and int().
* Specify the grammar of the string for complex().
* Improve the grammar of the string for float().
* Describe more explicitly the behavior when real and/or imag arguments are
  complex numbers. (This will be deprecated in future.)
(cherry picked from commit ec1ba264607b2b7b98d2602f5536a1d02981efc6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
17 months ago[3.13] gh-119791: Fix new Tkinter tests for wantobjects=0 (GH-119792) (GH-119794)
Miss Islington (bot) [Thu, 30 May 2024 19:16:57 +0000 (21:16 +0200)] 
[3.13] gh-119791: Fix new Tkinter tests for wantobjects=0 (GH-119792) (GH-119794)

PhotoImage.get() retruns a string instead of a 3-tuple of integers
in this case.
(cherry picked from commit e875c2d752fed0a8d16958dc7b331e66a2476247)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
17 months ago[3.13] gh-119729: Use 't' in pkg-config file name for free-threaded build (GH-119738...
Miss Islington (bot) [Thu, 30 May 2024 18:17:05 +0000 (20:17 +0200)] 
[3.13] gh-119729: Use 't' in pkg-config file name for free-threaded build (GH-119738) (#119797)

For example, the free-threaded build now generates
`lib/pkgconfig/python-3.13t.pc` and the debug build generates
`lib/pkgconfig/python-3.13d.pc`.
(cherry picked from commit 1c04c63ced5038e8f45a2aac7dc45f0815a4ddc5)

Co-authored-by: Sam Gross <colesbury@gmail.com>
17 months ago[3.13] gh-117398: Convert datetime.IsoCalendarDate To A Heap Type (gh-119637) (gh...
Miss Islington (bot) [Thu, 30 May 2024 16:53:09 +0000 (18:53 +0200)] 
[3.13] gh-117398: Convert datetime.IsoCalendarDate To A Heap Type (gh-119637) (gh-119695)

This is the only static type in the module that we will not keep static.

(cherry picked from commit 548a11d5cf1dbb32d86ce0c045130c77f50c1427)
(cherry-picked from commit 34f9b3e7244615d2372614b20e10250e68cc8e61)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Co-authored by: Kirill Podoprigora <kirill.bast9@mail.ru>

17 months ago[3.13] gh-119779: Fix pyporting howto docs (GH-119785) (#119788)
Miss Islington (bot) [Thu, 30 May 2024 16:09:31 +0000 (18:09 +0200)] 
[3.13] gh-119779: Fix pyporting howto docs (GH-119785) (#119788)

gh-119779: Fix pyporting howto docs (GH-119785)
(cherry picked from commit 6fb191be15fd49da10506de29b6393ffdf59b894)

Co-authored-by: Awbert <119314310+SweetyAngel@users.noreply.github.com>
17 months ago[3.13] gh-117142: Slightly hacky fix for memory leak of StgInfo (GH-119424) (GH-119468)
Miss Islington (bot) [Thu, 30 May 2024 09:24:42 +0000 (11:24 +0200)] 
[3.13] gh-117142: Slightly hacky fix for memory leak of StgInfo (GH-119424) (GH-119468)

gh-117142: Slightly hacky fix for memory leak of StgInfo (GH-119424)

Add a funciton that inlines PyObject_GetTypeData and skips
type-checking, so it doesn't need access to the CType_Type object.
This will break if the memory layout changes, but should
be an acceptable solution to enable ctypes in subinterpreters in
Python 3.13.

Mark _ctypes as safe for multiple interpreters

(cherry picked from commit a192547dfe7c4f184cc8b579c3eff2f61f642483)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
17 months ago[3.13] gh-118055: Update the finder glossary entry (GH-118278) (GH-119773)
Miss Islington (bot) [Thu, 30 May 2024 09:07:59 +0000 (11:07 +0200)] 
[3.13] gh-118055: Update the finder glossary entry (GH-118278) (GH-119773)

gh-118055: Update the finder glossary entry (GH-118278)
(cherry picked from commit db009348b4b7a4b0aec39472ea074c1b5feeba9b)

Co-authored-by: Lincoln <71312724+Lincoln-developer@users.noreply.github.com>
17 months ago[3.13] subprocess docs: Fix semantically important typo (GH-119752) (#119757)
Miss Islington (bot) [Thu, 30 May 2024 07:50:11 +0000 (09:50 +0200)] 
[3.13] subprocess docs: Fix semantically important typo (GH-119752) (#119757)

subprocess docs: Fix semantically important typo (GH-119752)

GH-25416 accidentally replaced a reference to the *stderr* argument of
`subprocess.run` with a reference to the *stdin* argument.  *stdin* is
not affected by the `check_output` option.
(cherry picked from commit 2cc3502f98bb9aea386ab55443fc077ddcdde91d)

Co-authored-by: Zachary Ware <zach@python.org>
17 months ago[3.13] GH-89727: Fix FD leak on `os.fwalk()` generator finalization. (GH-119766)...
Miss Islington (bot) [Thu, 30 May 2024 04:40:21 +0000 (06:40 +0200)] 
[3.13] GH-89727: Fix FD leak on `os.fwalk()` generator finalization. (GH-119766) (#119767)

GH-89727: Fix FD leak on `os.fwalk()` generator finalization. (GH-119766)

Follow-up to 3c890b50. Ensure we `os.close()` open file descriptors when
the `os.fwalk()` generator is finalized.
(cherry picked from commit a5fef800d31648d19cecc240a2fa0dc71371753e)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
17 months ago[3.13] GH-89727: Fix `os.fwalk()` recursion error on deep trees (GH-119638) (#119764)
Miss Islington (bot) [Thu, 30 May 2024 03:28:55 +0000 (05:28 +0200)] 
[3.13] GH-89727: Fix `os.fwalk()` recursion error on deep trees (GH-119638) (#119764)

GH-89727: Fix `os.fwalk()` recursion error on deep trees (GH-119638)

Implement `os.fwalk()` using a list as a stack to avoid emitting recursion
errors on deeply nested trees.
(cherry picked from commit 3c890b503c740767d0eb9a0e74b47f17a1e69452)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
17 months ago[3.13] gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and...
Miss Islington (bot) [Thu, 30 May 2024 01:28:31 +0000 (03:28 +0200)] 
[3.13] gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (GH-119480) (#119760)

gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (GH-119480)
(cherry picked from commit bf4ff3ad2e362801e87c85fffd9e140b774cef26)

Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
17 months ago[3.13] gh-117398: Add multiphase support to _datetime (gh-119694)
Eric Snow [Wed, 29 May 2024 21:54:47 +0000 (17:54 -0400)] 
[3.13] gh-117398: Add multiphase support to _datetime (gh-119694)

This is an unrevert of d58ebf0 (gh-119636), which was reverted by 9216a53 (gh-119639) due to problems which have been resolved.

This is minimal support for multiphase init. Subinterpreters are not supported yet. That will be addressed in a later change.

(cherry picked from commit 3e8b609)

Co-authored-by: Erlend E. Aasland erlend@python.org
17 months ago[3.13] GH-119169: Implement `pathlib.Path.walk()` using `os.walk()` (GH-119573) ...
Miss Islington (bot) [Wed, 29 May 2024 21:24:42 +0000 (23:24 +0200)] 
[3.13] GH-119169: Implement `pathlib.Path.walk()` using `os.walk()` (GH-119573) (#119750)

GH-119169: Implement `pathlib.Path.walk()` using `os.walk()` (GH-119573)

For silly reasons, pathlib's generic implementation of `walk()` currently
resides in `glob._Globber`. This commit moves it into
`pathlib._abc.PathBase.walk()` where it really belongs, and makes
`pathlib.Path.walk()` call `os.walk()`.
(cherry picked from commit 7ff61f51b6f75315291419269295a8ac3933397b)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
17 months ago[3.13] GH-89727: Partially fix `shutil.rmtree()` recursion error on deep trees (GH...
Miss Islington (bot) [Wed, 29 May 2024 20:41:03 +0000 (22:41 +0200)] 
[3.13] GH-89727: Partially fix `shutil.rmtree()` recursion error on deep trees (GH-119634) (#119748)

GH-89727: Partially fix `shutil.rmtree()` recursion error on deep trees (GH-119634)

Make `shutil._rmtree_unsafe()` call `os.walk()`, which is implemented
without recursion.

`shutil._rmtree_safe_fd()` is not affected and can still raise a recursion
error.

(cherry picked from commit a150679f90c6e3f017bd75cac3b8f727063cc4aa)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
17 months agogh-119070: Fix py.exe handling of /usr/bin/env commands missing extension (GH-119426)
Miss Islington (bot) [Wed, 29 May 2024 20:06:38 +0000 (22:06 +0200)] 
gh-119070: Fix py.exe handling of /usr/bin/env commands missing extension (GH-119426)

(cherry picked from commit df93f5d4bf9d70036d485666d4dd4f009d37f8b9)

Co-authored-by: Steve Dower <steve.dower@python.org>
17 months ago[3.13] gh-119525: Fix deadlock with `_PyType_Lookup` and the GIL (GH-119527) (#119746)
Miss Islington (bot) [Wed, 29 May 2024 19:47:47 +0000 (21:47 +0200)] 
[3.13] gh-119525: Fix deadlock with `_PyType_Lookup` and the GIL (GH-119527) (#119746)

The deadlock only affected the free-threaded build and only occurred
when the GIL was enabled at runtime. The `Py_DECREF(old_name)` call
might temporarily release the GIL while holding the type seqlock.
Another thread may spin trying to acquire the seqlock while holding the
GIL.

The deadlock occurred roughly 1 in ~1,000 runs of `pool_in_threads.py`
from `test_multiprocessing_pool_circular_import`.
(cherry picked from commit c22323cd1c200ca1b22c47af95f67c4b2d661fe7)

Co-authored-by: Sam Gross <colesbury@gmail.com>
17 months ago[3.13] gh-119555: catch SyntaxError from compile() in the InteractiveColoredConsole...
Miss Islington (bot) [Wed, 29 May 2024 11:04:45 +0000 (13:04 +0200)] 
[3.13] gh-119555: catch SyntaxError from compile() in the InteractiveColoredConsole (GH-119557) (#119709)

17 months ago[3.13] gh-119661: Add _Py_SINGLETON() include in Argumenet Clinic (#119712) (#119716)
Victor Stinner [Wed, 29 May 2024 10:32:00 +0000 (12:32 +0200)] 
[3.13] gh-119661: Add _Py_SINGLETON() include in Argumenet Clinic (#119712) (#119716)

gh-119661: Add _Py_SINGLETON() include in Argumenet Clinic (#119712)

When the _Py_SINGLETON() is used, Argument Clinic now adds an
explicit "pycore_runtime.h" include to get the macro. Previously, the
macro may or may not be included indirectly by another include.

(cherry picked from commit 7ca74a760a5d3cdf48159f003d4db7c2778e9261)

17 months ago[3.13] gh-119704: Fix reference leak in the ``Python/Python-tokenize.c`` (GH-119705...
Miss Islington (bot) [Wed, 29 May 2024 07:26:13 +0000 (09:26 +0200)] 
[3.13] gh-119704: Fix reference leak in the ``Python/Python-tokenize.c`` (GH-119705) (#119707)

17 months ago[3.13] gh-119443: Turn off from __future__ import annotations in REPL (GH-119493...
Miss Islington (bot) [Wed, 29 May 2024 01:26:19 +0000 (03:26 +0200)] 
[3.13] gh-119443: Turn off from __future__ import annotations in REPL (GH-119493) (#119697)

gh-119443: Turn off from __future__ import annotations in REPL (GH-119493)
(cherry picked from commit a8e35e8ebad8c3bb44d14968aa05d1acbc028247)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
17 months ago[3.13] gh-119538: Add missing expat build dependencies (GH-119647) (#119685)
Miss Islington (bot) [Tue, 28 May 2024 22:10:59 +0000 (00:10 +0200)] 
[3.13] gh-119538: Add missing expat build dependencies (GH-119647) (#119685)

xmltok_impl.c and xmltok_ns.c are _included_ in xmltok.c by the C
pre-processor.

(cherry picked from commit 606be663622c6784aed4ffa55b877adbd6fe8e54)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
17 months ago[3.13] gh-117398: Statically Allocate the Datetime C-API (GH-119472) (gh-119641)
Eric Snow [Tue, 28 May 2024 21:00:04 +0000 (17:00 -0400)] 
[3.13] gh-117398: Statically Allocate the Datetime C-API (GH-119472) (gh-119641)

This is a backport of 3 commits that go together.

(cherry picked from commit a895756)
(cherry picked from commit b30d30c)
(cherry picked from commit a89fc26)

17 months ago[3.13] gh-119118: Fix performance regression in tokenize module (GH-119615) (#119682)
Miss Islington (bot) [Tue, 28 May 2024 20:47:45 +0000 (22:47 +0200)] 
[3.13] gh-119118: Fix performance regression in tokenize module (GH-119615) (#119682)

- Cache line object to avoid creating a Unicode object
  for all of the tokens in the same line.
- Speed up byte offset to column offset conversion by using the
  smallest buffer possible to measure the difference.

(cherry picked from commit d87b0151062e36e67f9e42e1595fba5bf23a485c)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
17 months ago[3.13] gh-119011: `type.__type_params__` now return an empty tuple (GH-119296) (...
Miss Islington (bot) [Tue, 28 May 2024 19:09:04 +0000 (21:09 +0200)] 
[3.13] gh-119011: `type.__type_params__` now return an empty tuple (GH-119296) (#119678)

(cherry picked from commit 6b240c2308a044e38623900ccb8fa58c3549d4ae)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
17 months ago[3.13] gh-119311: Fix name mangling with PEP 695 generic classes (#119464) (#119643)
Jelle Zijlstra [Tue, 28 May 2024 18:03:33 +0000 (11:03 -0700)] 
[3.13] gh-119311: Fix name mangling with PEP 695 generic classes (#119464) (#119643)

Fixes #119311. Fixes #119395.

(cherry picked from commit a9a74da4a0ca0645f049e67b6434a95e30592c32)

17 months ago[3.13] gh-119581: Add a test of InitVar with name shadowing (GH-119582) (#119672)
Miss Islington (bot) [Tue, 28 May 2024 17:41:02 +0000 (19:41 +0200)] 
[3.13] gh-119581: Add a test of InitVar with name shadowing (GH-119582) (#119672)

gh-119581: Add a test of InitVar with name shadowing (GH-119582)
(cherry picked from commit 6ec371223dff4da7719039e271f35a16a5b861c6)

Co-authored-by: Steven Troxler <steven.troxler@gmail.com>
17 months ago[3.13] Clarify base64.a85encode docs: *wrapcols* doesn't count the newline (GH-119409...
Miss Islington (bot) [Tue, 28 May 2024 14:55:37 +0000 (16:55 +0200)] 
[3.13] Clarify base64.a85encode docs: *wrapcols* doesn't count the newline (GH-119409) (GH-119483)

Clarify base64.a85encode docs: *wrapcols* doesn't count the newline (GH-119409)
(cherry picked from commit ffa24aab107b5bc3c6ad31a6a245c226bf24b208)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
17 months ago[3.13] [doc] Clarify the nature of the root logger in the `logging` documentation...
Miss Islington (bot) [Tue, 28 May 2024 14:04:46 +0000 (16:04 +0200)] 
[3.13] [doc] Clarify the nature of the root logger in the `logging` documentation (GH-119440) (GH-119651)

(cherry picked from commit b407ad38fb93585332c370b8fa56905fb238cdfd)

17 months ago[3.13] Re-order imports to align with zipp 3.18.2 (GH-119587) (#119589)
Miss Islington (bot) [Tue, 28 May 2024 12:49:13 +0000 (14:49 +0200)] 
[3.13] Re-order imports to align with zipp 3.18.2 (GH-119587) (#119589)

Re-order imports to align with zipp 3.18.2 (GH-119587)
(cherry picked from commit 5482a939ac18f4cd861d212c759960af8fa2b19d)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
17 months ago[3.13] gh-116860: Remove outdated `test_parserhack` from `test_future` (GH-116861...
Miss Islington (bot) [Tue, 28 May 2024 09:55:37 +0000 (11:55 +0200)] 
[3.13] gh-116860: Remove outdated `test_parserhack` from `test_future` (GH-116861) (#119649)

gh-116860: Remove outdated `test_parserhack` from `test_future` (GH-116861)
(cherry picked from commit 669175bf8edc2c02d48401bac0e4c7d99a33f15b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
17 months ago[3.13] gh-117398: Revert gh-119636, Add multiphase support to _datetime (#119639) 119642/head
Eric Snow [Tue, 28 May 2024 00:52:52 +0000 (20:52 -0400)] 
[3.13] gh-117398: Revert gh-119636, Add multiphase support to _datetime (#119639)

Revert "[3.13] gh-117398: Add multiphase support to _datetime (gh-119373) (gh-119636)"

This reverts commit d58ebf073c755c2f0f6e4ef2296b48a4c75e5f1c.

17 months ago[3.13] gh-119317: findall instead of traverse for docutils nodes (GH-119319) (#119486)
Miss Islington (bot) [Mon, 27 May 2024 23:46:15 +0000 (01:46 +0200)] 
[3.13] gh-119317: findall instead of traverse for docutils nodes (GH-119319) (#119486)

gh-119317: findall instead of traverse for docutils nodes (GH-119319)
(cherry picked from commit 0867bce45768454ee31bee95ca33fdc2c9d8b0fa)

Co-authored-by: Carlos Meza <hire@carlosmeza.com>
17 months ago[3.13] gh-117398: Add multiphase support to _datetime (gh-119373) (gh-119636)
Miss Islington (bot) [Mon, 27 May 2024 22:36:32 +0000 (00:36 +0200)] 
[3.13] gh-117398: Add multiphase support to _datetime (gh-119373) (gh-119636)

This is minimal support.  Subinterpreters are not supported yet.  That will be addressed in a later change.

(cherry picked from commit 3e8b60905e97a4fe89bb24180063732214368938)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
17 months ago[3.13] gh-119584: Fix test_import Failed Assertion (gh-119623) (gh-119633)
Miss Islington (bot) [Mon, 27 May 2024 20:04:13 +0000 (22:04 +0200)] 
[3.13] gh-119584: Fix test_import Failed Assertion (gh-119623) (gh-119633)

The fix in gh-119561 introduced an assertion that doesn't hold true if any of the three new test extension modules are loaded more than once.  This is fine normally but breaks if the new test_check_state_first() is run more than once, which happens for refleak checking and with the regrtest --forever flag.  We fix that here by clearing each of the three modules after loading them.  We also tweak a check in _modules_by_index_check().

(cherry picked from commit ae7b17673f29efe17b416cbcfbf43b5b3ff5977c)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
17 months ago[3.13] gh-119560: Drop an Invalid Assert in PyState_FindModule() (gh-119561) (gh...
Miss Islington (bot) [Mon, 27 May 2024 19:11:29 +0000 (21:11 +0200)] 
[3.13] gh-119560: Drop an Invalid Assert in PyState_FindModule() (gh-119561) (gh-119632)

The assertion was added in gh-118532 but was based on the invalid assumption that PyState_FindModule() would only be called with an already-initialized module def.  I've added a test to make sure we don't make that assumption again.

(cherry picked from commit 0c5ebe13e9937c446e9947c44f2570737ecca135)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
17 months ago[3.13] Docs: Move inline JavaScript to own file to reduce duplication (GH-119541...
Hugo van Kemenade [Mon, 27 May 2024 18:49:52 +0000 (21:49 +0300)] 
[3.13] Docs: Move inline JavaScript to own file to reduce duplication (GH-119541) (#119630)

17 months ago[3.13] Misc cleanups and wording improvements for the itertools docs (gh-119626)...
Miss Islington (bot) [Mon, 27 May 2024 18:44:11 +0000 (20:44 +0200)] 
[3.13] Misc cleanups and wording improvements for the itertools docs (gh-119626) (gh-119629)

17 months ago[3.13] gh-119580: Improve version added section for convenience variable (GH-119583...
Miss Islington (bot) [Mon, 27 May 2024 18:13:01 +0000 (20:13 +0200)] 
[3.13] gh-119580: Improve version added section for convenience variable (GH-119583) (#119624)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
17 months ago[3.13] Docs: Only install sphinx-autobuild for `make htmllive` (GH-119607) (#119621)
Miss Islington (bot) [Mon, 27 May 2024 17:44:55 +0000 (19:44 +0200)] 
[3.13] Docs: Only install sphinx-autobuild for `make htmllive` (GH-119607) (#119621)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
17 months ago[3.13] gh-119467: Fix Py_buffer.format type and correct documentation typo (GH-119475...
Miss Islington (bot) [Mon, 27 May 2024 12:34:13 +0000 (14:34 +0200)] 
[3.13] gh-119467: Fix Py_buffer.format type and correct documentation typo (GH-119475) (#119602)

gh-119467: Fix Py_buffer.format type and correct documentation typo (GH-119475)
(cherry picked from commit 3b26cd8ca0e6c65e4b61effea9aa44d06e926797)

Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>