Commit Graph

29306 Commits

Author SHA1 Message Date
Miss Islington (bot) 03cd44759f
[3.13] gh-119666: fix multiple class-scope comprehensions referencing __class__ (GH-120295) (#120299) 2024-06-10 00:37:28 -04:00
Miss Islington (bot) c15f94d6fb
[3.13] bpo-37755: Use configured output in pydoc instead of pager (GH-15105) (GH-120261)
If the Helper() class was initialized with an output, the topics, keywords
and symbols help still use the pager instead of the output.
Change the behavior so  the output is used if available while keeping the
previous behavior if no output was configured.
(cherry picked from commit 2080425154)

Co-authored-by: Enrico Tröger <enrico.troeger@uvena.de>
2024-06-08 17:48:47 +00:00
Miss Islington (bot) 4bca4e58af
[3.13] gh-120121: Add InvalidStateError to concurrent.futures.__all__ (GH-120123) (#120273)
gh-120121: Add InvalidStateError to concurrent.futures.__all__ (GH-120123)
(cherry picked from commit 5d59b870ef)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-08 16:35:10 +00:00
Miss Islington (bot) 9b704ceeca
[3.13] gh-120244: Fix re.sub() reference leak (GH-120245) (GH-120264)
(cherry picked from commit 38a25e9560)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2024-06-08 14:10:28 +03:00
Miss Islington (bot) 3be7e91d03
[3.13] gh-120225: fix crash in compiler on empty block at end of exception handler (GH-120235) (#120249)
gh-120225: fix crash in compiler on empty block at end of exception handler (GH-120235)
(cherry picked from commit 4fc82b6d3b)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-07 22:01:20 +00:00
Miss Islington (bot) 8368b67d1b
[3.13] gh-120211: Fix tkinter.ttk with Tcl/Tk 9.0 (GH-120213) (GH-120215)
* Use new methods for tracing Tcl variable.
* Fix Combobox.current() for empty combobox.
(cherry picked from commit d68a22e7a6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-07 15:00:30 +00:00
Miss Islington (bot) f0165d00b7
[3.13] gh-112672: Fix builtin Tkinter with Tcl 9.0 (GH-112681) (GH-120208)
* Add declaration of Tcl_AppInit(), missing in Tcl 9.0.
* Use Tcl_Size instead of int where needed.

(cherry picked from commit e079935282)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-07 10:12:31 +00:00
Miss Islington (bot) 56a7e04834
[3.13] gh-119577: Adjust DeprecationWarning when testing element truth values in ElementTree (GH-119762) (GH-120189)
gh-119577: Adjust DeprecationWarning when testing element truth values in ElementTree (GH-119762)

Adjust DeprecationWarning when testing element truth values in ElementTree, we're planning to go with the more natural True return rather than a disruptive harder to code around exception raise, and are deferring the behavior change for a few more releases.
(cherry picked from commit 6b606522ca)

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2024-06-07 03:43:17 +00:00
Thomas Wouters 3a83b172af Python 3.13.0b2 2024-06-05 16:46:34 +02:00
Łukasz Langa eea45ea213
[3.13] gh-119842: Honor PyOS_InputHook in the new REPL (GH-119843) (GH-120066)
(cherry picked from commit d9095194dd)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2024-06-04 21:26:10 +02:00
Miss Islington (bot) 2acbdc23ad
[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 7111d9605f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-04 17:19:13 +00:00
Miss Islington (bot) 34a6d89788
[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 42a34ddb0b)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-06-04 10:56:06 -04:00
Miss Islington (bot) 23ebf87eaa
[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 8d63c8d47b)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-06-04 10:54:59 -04:00
Miss Islington (bot) 720a44d414
[3.13] gh-119819: Fix regression to allow logging configuration with multipr… (GH-120030) (GH-120035)
(cherry picked from commit 99d945c0c0)
2024-06-04 13:46:41 +01:00
Miss Islington (bot) feaecf8c33
[3.13] gh-118868: logging QueueHandler fix passing of kwargs (GH-118869) (GH-120032)
(cherry picked from commit dce14bb2dc)
2024-06-04 13:18:11 +01:00
Miss Islington (bot) 1177897551
[3.13] gh-111389: Add PyHASH_MULTIPLIER constant (GH-119214) (#119334)
gh-111389: Add PyHASH_MULTIPLIER constant (GH-119214)
(cherry picked from commit f6da790122)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-06-04 09:26:25 +02:00
T. Wouters 6be55f1bed
[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 1c8f912ebd.
(cherry picked from commit 31a4fb3c74)
2024-06-04 08:36:16 +02:00
Miss Islington (bot) e5fb3a2385
[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 105f22ea46, AKA gh-119929)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-06-03 23:37:28 +00:00
Miss Islington (bot) c348e27cc1
[3.13] gh-117142: Support Importing ctypes in Isolated Interpreters (gh-120008)
This makes the support official.

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

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-06-03 23:06:56 +00:00
Miss Islington (bot) 6b10467fbc
[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 2e0aa731ae)

Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
2024-06-03 17:31:26 +00:00
Miss Islington (bot) 671b740f45
gh-119679: Ensures correct import libraries are included in Windows install packages (GH-119790)
(cherry picked from commit fd01271366)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-06-03 15:06:53 +00:00
Miss Islington (bot) b26b410ce9
gh-102511: Amend 3.13.0b1.rst (GH-119895)
(cherry picked from commit 4765e1fa29)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-06-03 13:46:40 +00:00
Miss Islington (bot) cc663b7e25
[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 e50fac96e8)

Co-authored-by: Ethan Smith <ethan@ethanhs.me>
2024-06-03 09:29:07 +00:00
Miss Islington (bot) 225c3cd6c1
[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 53b1981fb0)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-06-01 20:38:55 +01:00
Miss Islington (bot) 0ea77d49cc
[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 cf3bba3f06)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-06-01 16:27:54 +00:00
Victor Stinner 4e147caf3f
[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 0bab0b3a53.

The change modified how negative values, like termios.TIOCSWINSZ, was
treated and is actually backward incompatible.
2024-06-01 17:08:23 +02:00
Jelle Zijlstra a0559849ac
[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 80a4e38994)
2024-05-31 21:56:26 -07:00
Miss Islington (bot) a5272e63ef
[3.13] gh-118894: Make asyncio REPL use pyrepl (GH-119433) (#119884)
(cherry picked from commit 2237946af0)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-31 17:15:44 -04:00
Miss Islington (bot) a7e81fdfc1
[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 078b8c8cf2)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-05-31 14:19:38 -04:00
Miss Islington (bot) 8e0777df1f
gh-119690: Adds Unicode support for named pipes in _winapi (GH-119717)
(cherry picked from commit 78d697b7d5)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-05-31 16:22:30 +00:00
Miss Islington (bot) ea48de4f4f
[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 bcc1be39cb)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-05-31 15:29:50 +00:00
Miss Islington (bot) d6faac6d1f
[3.13] gh-111201: Support pyrepl on Windows (GH-119559) (GH-119850)
(cherry picked from commit 0d07182821)

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>
2024-05-31 17:18:28 +02:00
Miss Islington (bot) 6e57bd01e0
gh-116145: Updated bundled Tcl/Tk on Windows to 8.6.14 (GH-117030)
(cherry picked from commit 0e8d35b931)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-05-31 12:38:03 +00:00
Miss Islington (bot) 5539bd9df2
[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 94e9585e99)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
2024-05-31 10:42:24 +00:00
Miss Islington (bot) 8470593a98
[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 e3bac04c37)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2024-05-31 08:35:21 +00:00
Miss Islington (bot) 608cfb8b41
[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 1c04c63ced)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-05-30 18:17:05 +00:00
Miss Islington (bot) 810a09ad37
[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 3c890b503c)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-05-30 03:28:55 +00:00
Miss Islington (bot) 061abf8e4c
[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 a150679f90)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-05-29 20:41:03 +00:00
Miss Islington (bot) c3cfc04a73
gh-119070: Fix py.exe handling of /usr/bin/env commands missing extension (GH-119426)
(cherry picked from commit df93f5d4bf)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-05-29 20:06:38 +00:00
Miss Islington (bot) dcfbd3be9f
[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 c22323cd1c)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-05-29 19:47:47 +00:00
Miss Islington (bot) 40a024c983
[3.13] gh-119555: catch SyntaxError from compile() in the InteractiveColoredConsole (GH-119557) (#119709) 2024-05-29 12:04:45 +01:00
Miss Islington (bot) 17d3398486
[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 a8e35e8eba)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-05-29 01:26:19 +00:00
Eric Snow 12a580b82d
[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)
2024-05-28 21:00:04 +00:00
Miss Islington (bot) 0d0be6b3ef
[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 d87b015106)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2024-05-28 22:47:45 +02:00
Miss Islington (bot) c0e9961798
[3.13] gh-119011: `type.__type_params__` now return an empty tuple (GH-119296) (#119678)
(cherry picked from commit 6b240c2308)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-05-28 19:09:04 +00:00
Jelle Zijlstra 6394a72e99
[3.13] gh-119311: Fix name mangling with PEP 695 generic classes (#119464) (#119643)
Fixes #119311. Fixes #119395.

(cherry picked from commit a9a74da4a0)
2024-05-28 11:03:33 -07:00
Miss Islington (bot) bd9983cab8
[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 0c5ebe13e9)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-05-27 19:11:29 +00:00
Miss Islington (bot) 46d7712829
[3.13] Fix typos in HISTORY documentation (GH-119453) (#119597)
Co-authored-by: Xie Yanbo <xieyanbo@gmail.com>
2024-05-27 08:13:49 +00:00
Miss Islington (bot) f49749cf8f
[3.13] gh-111999: Fix the signature of str.format_map() (GH-119540) (#119543)
(cherry picked from commit 08e65430aa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-05-25 13:46:41 +00:00
Miss Islington (bot) cc38ee1edb
gh-118263: Add additional arguments to path_t (Argument Clinic type) in posixmodule (GH-118355)
(cherry picked from commit 96b392df30)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-05-24 18:26:06 +00:00