Commit graph

124272 commits

Author SHA1 Message Date
Miss Islington (bot)
a2bf7a0a47
[3.13] gh-124096: Enable REPL virtual terminal support on Windows (GH-124119) (GH-133457)
To support virtual terminal mode in Windows PYREPL, we need a scanner
to read over the supported escaped VT sequences.

Windows REPL input was using virtual key mode, which does not support
terminal escape sequences. This patch calls `SetConsoleMode` properly
when initializing and send sequences to enable bracketed-paste modes
to support verbatim copy-and-paste.
(cherry picked from commit a65366ed87)

Co-authored-by: Y5 <124019959+y5c4l3@users.noreply.github.com>
Signed-off-by: y5c4l3 <y5c4l3@proton.me>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Dustin L. Howett <dustin@howett.net>
Co-authored-by: wheeheee <104880306+wheeheee@users.noreply.github.com>
2025-05-05 19:39:06 +02:00
Miss Islington (bot)
1105ed316b
[3.13] GH-133410: Use commit hashes for change detection (gh-133416) (#133427)
GH-133410: Use commit hashes for change detection (gh-133416)
(cherry picked from commit d530e74e44)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-05 10:26:58 -07:00
Miss Islington (bot)
d84a762a64
[3.13] gh-63882: Break down and tests in test_minidom (GH-133026) (#133451)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-05 19:31:53 +03:00
Łukasz Langa
87b14c8f21
[3.13] gh-131878: Handle top level exceptions in new pyrepl and prevent of closing it (GH-131910) (GH-133445)
Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
2025-05-05 17:20:54 +02:00
Miss Islington (bot)
f371b23bab
[3.13] gh-107006: Move threading.local docstring to docs (GH-131840) (#133432)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-05-05 16:18:00 +03:00
Miss Islington (bot)
df1669ed20
[3.13] Bump mypy to 1.15 (GH-133405) (#133429)
Bump mypy to 1.15 (GH-133405)
(cherry picked from commit 8467026ed6)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-05 10:54:56 +00:00
Miss Islington (bot)
e89ca3991c
[3.13] [tests] test_subprocess maybe avoid a timeout race condition? (GH-133420) (#133421)
[tests] test_subprocess maybe avoid a timeout race condition? (GH-133420)

The few buildbot failures on https://github.com/python/cpython/pull/133103
are possibly just due to racing a child process launch and exit?
(cherry picked from commit b64aa302d7)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-05-05 04:25:41 +00:00
Miss Islington (bot)
3d1b8e2a96
[3.13] gh-133089: Use original timeout value for TimeoutExpired when the func subprocess.run is called with a timeout (GH-133103) (#133418)
gh-133089: Use original timeout value for `TimeoutExpired` when the func `subprocess.run` is called with a timeout (GH-133103)
(cherry picked from commit 2bbcaedb75)

Signed-off-by: Manjusaka <me@manjusaka.me>
Co-authored-by: Nadeshiko Manju <me@manjusaka.me>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-05-05 01:38:30 +00:00
Miss Islington (bot)
5daeebbbf2
[3.13] gh-109700: Improve stress tests for interpreter creation (GH-109946) (GH-133391)
* Ensure that destructors are called in the test that created interpreters, not after finishing it.
* Try to create/run interpreters in threads simultaneously.
* Mark tests that requires over 6GB of memory with bigmemtest.
(cherry picked from commit 61b50a98b4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-04 19:18:49 +00:00
Serhiy Storchaka
973e2d3e29
[3.13] gh-122559: Synchronize C and Python implementation of the io module about pickling (GH-122628) (GH-133381)
In the C implementation, remove __reduce__ and __reduce_ex__ methods
that always raise TypeError and restore __getstate__ methods that always
raise TypeErrori.

This restores fine details of the pre-3.12 behavior and unifies
both implementations.
(cherry picked from commit e9253ebf74)
2025-05-04 16:04:09 +00:00
Serhiy Storchaka
3c9d1778ef
[3.13] bpo-44172: Keep reference to original window in curses subwindow objects (GH-26226) (GH-133370)
The X/Open curses specification[0] and ncurses documentation[1]
both state that subwindows must be deleted before the main window.

Deleting the windows in the wrong order causes a double-free with
NetBSD's curses implementation.

To fix this, keep track of the original window object in the subwindow
object, and keep a reference to the original for the lifetime of
the subwindow.

[0] https://pubs.opengroup.org/onlinepubs/7908799/xcurses/delwin.html
[1] https://invisible-island.net/ncurses/man/curs_window.3x.html
(cherry picked from commit 0af61fe2f4)

Co-authored-by: Michael Forney <mforney@mforney.org>
2025-05-04 11:15:43 +00:00
Miss Islington (bot)
e090f8e3f5
[3.13] gh-133210: Fix test_rlcompleter in --without-doc-strings mode (GH-133332) (#133348)
gh-133210: Fix `test_rlcompleter` in `--without-doc-strings` mode (GH-133332)
(cherry picked from commit 881144fa58)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-03 16:01:36 +00:00
Miss Islington (bot)
85252236b1
[3.13] gh-133117: Enable stricter mypy checks for tomllib (GH-133206) (#133343)
gh-133117: Enable stricter mypy checks for `tomllib` (GH-133206)
(cherry picked from commit cb3174113e)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-03 14:20:34 +00:00
Hugo van Kemenade
130491f6cc
[3.13] gh-130160: use .. program:: directive for documenting platform CLI (GH-133335) (#133341)
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
2025-05-03 15:37:09 +03:00
Miss Islington (bot)
c9c0beb00d
[3.13] gh-114713: Revert gh-114731 (GH-133330) (#133331)
gh-114713: Revert gh-114731 (GH-133330)

Revert "gh-114713: Handle case of an empty string passed to `zoneinfo.ZoneInfo` (GH-114731)"

This reverts commit 884df116d7.
(cherry picked from commit fe44fc4f43)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2025-05-03 08:09:54 +00:00
Miss Islington (bot)
bb0a8575a7
gh-91156: Document how TextIOWrapper interacts with UTF-8 mode (GH-132885)
Document how TextIOWrapper interacts with UTF-8 mode
(cherry picked from commit 245cd6c532)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-05-03 11:38:35 +09:00
Miss Islington (bot)
8a05dbe004
[3.13] gh-132995: Upgrade bundled pip to 25.1.1 (gh-133308)
gh-132995: Upgrade bundled pip to 25.1.1 (gh-132997)

* gh-132995: Upgrade bundled pip to 25.1.1
(cherry picked from commit a512905e15)

Co-authored-by: Paul Moore <p.f.moore@gmail.com>
2025-05-02 18:26:38 +01:00
Miss Islington (bot)
e2ad2c8042
[3.13] gh-112936: Fix IDLE: no Shell menu item in single-process mode (GH-126598) (GH-133310)
(cherry picked from commit 7e7e49be78)

Co-authored-by: Zhikang Yan <2951256653@qq.com>
2025-05-02 17:26:26 +00:00
Miss Islington (bot)
e75f528e78
[3.13] gh-133290: Use PyObject_SetAttr to set _type_ (GH-133292) (GH-133295)
gh-133290: Use PyObject_SetAttr to set _type_ (GH-133292)
(cherry picked from commit 2590774c9b)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-05-02 18:10:32 +02:00
Miss Islington (bot)
16e9e74a8b
[3.13] gh-132385: Fix instance error suggestions trigger potential exceptions in traceback (GH-132387) (#133297)
gh-132385: Fix instance error suggestions trigger potential exceptions in `traceback` (GH-132387)
(cherry picked from commit 641253cfac)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-02 13:27:54 +00:00
Miss Islington (bot)
6a919d0488
[3.13] gh-133210: Fix test_descr in --without-doc-strings mode (GH-133294) (#133298)
gh-133210: Fix `test_descr` in `--without-doc-strings` mode (GH-133294)
(cherry picked from commit ba16ba3a18)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-02 13:27:30 +00:00
Miss Islington (bot)
b225ce7744
[3.13] Docs: delete title links in turtle.rst and typing.rst (GH-133283) (#133293)
Co-authored-by: Yongzi Li <1538321957@qq.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-05-02 13:24:12 +01:00
Miss Islington (bot)
b64cc74b14
[3.13] gh-133210: Fix test_pydoc in --without-doc-strings mode (GH-133271) (#133288)
gh-133210: Fix `test_pydoc` in `--without-doc-strings` mode (GH-133271)
(cherry picked from commit 4912b29166)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-02 10:36:35 +00:00
Tomas R.
ae775dcc24
[3.13] gh-130197: Improve test coverage of msgfmt.py (GH-133048) (GH-133255)
(cherry picked from commit c73d46076e)
2025-05-02 07:28:28 +00:00
Miss Islington (bot)
766c5f75b9
[3.13] gh-119605: Respect follow_wrapped for __init__ and __new__ when getting class signature with inspect.signature (GH-132055) (#133277)
gh-119605: Respect `follow_wrapped` for `__init__` and `__new__` when getting class signature with `inspect.signature` (GH-132055)
(cherry picked from commit b8633f9aca)

Co-authored-by: Xuehai Pan <XuehaiPan@pku.edu.cn>
2025-05-01 20:06:07 -07:00
Miss Islington (bot)
f7d1109a12
[3.13] gh-133210: Fix test_inspect in --without-doc-strings mode (GH-133250) (#133263)
gh-133210: Fix `test_inspect` in `--without-doc-strings` mode (GH-133250)
(cherry picked from commit 27e011455d)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-01 16:36:12 +00:00
Miss Islington (bot)
90c786e377
[3.13] gh-130655: Add a test for big-endian MO files in gettext (GH-132469) (GH-133248)
(cherry picked from commit 474f296718)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-05-01 11:36:06 +00:00
Miss Islington (bot)
679e632c5e
[3.13] gh-132246: Add PEP 688 to C Buffer Protocol docs (GH-132249) (#132282)
gh-132246: Add PEP 688 to C Buffer Protocol docs (GH-132249)
(cherry picked from commit 8421b648e9)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-05-01 12:09:33 +01:00
Miss Islington (bot)
bf8eecdca7
[3.13] gh-131531: Make Android build retry after network failures (GH-133193) (#133236)
Adds a retry strategy when downloading compilation resources for Android, plus some other cleanups.
(cherry picked from commit feac343d1a)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-05-01 04:41:44 +00:00
Miss Islington (bot)
f68be0f38e
[3.13] gh-133183: Include IPHONEOS_DEPLOYMENT_TARGET in iOS shim targets. (GH-133184) (#133234)
Include IPHONEOS_DEPLOYMENT_TARGET in iOS shim targets.
(cherry picked from commit 6e907c4d1f)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-05-01 02:59:27 +00:00
Miss Islington (bot)
4f006ffdb9
[3.13] Apply 'mod' role to typing module (GH-133201) (#133217)
Apply 'mod' role to typing module (GH-133201)
(cherry picked from commit 2b67db7ce3)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-04-30 16:58:19 +00:00
Miss Islington (bot)
110bec88bf
[3.13] Remove redundant `--keep-going` when running Sphinx (GH-133156) (#133214)
Remove redundant ``--keep-going`` when running Sphinx (GH-133156)
(cherry picked from commit c78216e42c)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-04-30 17:44:00 +01:00
Miss Islington (bot)
704a3f8c0a
[3.13] gh-133167: Fix compilation process with --enable-optimizations and --without-docstrings (GH-133187) (#133207)
gh-133167: Fix compilation process with `--enable-optimizations` and `--without-docstrings` (GH-133187)
(cherry picked from commit cc39b19f0f)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-04-30 14:06:31 +00:00
Miss Islington (bot)
0458554482
[3.13] gh-133117: Run mypy on tomllib in CI (GH-133118) (#133192)
gh-133117: Run mypy on `tomllib` in CI (GH-133118)
(cherry picked from commit 5ea9010e89)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-04-30 12:57:57 +00:00
Miss Islington (bot)
13f5a9a0f3
[3.13] Add profile-gen-stamp to .gitignore (GH-133188) (#133189)
Add `profile-gen-stamp` to `.gitignore` (GH-133188)
(cherry picked from commit c4b7f7c7ff)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-04-30 08:16:59 +00:00
Miss Islington (bot)
dfaa384991
[3.13] gh-132308: prevent TracebackException swallowing attributes of a falsey Exception or ExceptionGroup (GH-132363) (#132725)
gh-132308: prevent `TracebackException` swallowing attributes of a falsey `Exception` or `ExceptionGroup` (GH-132363)
(cherry picked from commit 69cda31261)

Co-authored-by: Duprat <yduprat@gmail.com>
2025-04-30 09:19:53 +02:00
Miss Islington (bot)
7998f998b2
[3.13] gh-133131: Discover an appropriate iOS simulator rather than hard-coding iPhone SE 3rd gen (GH-133132) (#133173)
Determines a candidate simulator at runtime rather than hardcoding iPhone SE.
(cherry picked from commit 42b0b0667e)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-04-29 21:59:21 +00:00
Stan Ulbrych
ff4134603a
[3.13] gh-46236: Document PyUnicodeIter_Type (GH-132925) (GH-133149)
gh-46236: Document `PyUnicodeIter_Type` (GH-132925)

(cherry picked from commit bba14c3e01)

# Conflicts:
#	Doc/c-api/unicode.rst
2025-04-29 18:11:31 +02:00
Miss Islington (bot)
dcbda412a1
[3.13] gh-57281: Fix duplicate deprecation note: array 'u' format (GH-133113) (#133147)
gh-57281: Fix duplicate deprecation note: array 'u' format (GH-133113)
(cherry picked from commit 59ff42155a)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-04-29 11:30:03 +00:00
Miss Islington (bot)
0b1e676f70
[3.13] Run mypy workflow on _colorize.py and Misc/mypy/** changes (GH-133116) (#133133)
Run mypy workflow on `_colorize.py` and `Misc/mypy/**` changes (GH-133116)
(cherry picked from commit 01f11a0e4e)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-04-29 08:48:08 +00:00
Mark Shannon
132bdf6990
[3.13] GH-127682: Backport GH-132351 (GH-132384)
Only call `__iter__` once in generator expressions
2025-04-29 09:35:29 +01:00
Donghee Na
7ffef8d07b
[3.13] gh-132070: Use _PyObject_IsUniquelyReferenced in unicodeobject (gh-133039) (gh-133126)
* gh-132070: Use _PyObject_IsUniquelyReferenced in unicodeobject (gh-133039)

---------
(cherry picked from commit 75cbb8d89e)

Co-authored-by: Donghee Na <donghee.na@python.org>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

* Add _PyObject_IsUniquelyReferenced

---------

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-04-29 14:26:44 +09:00
Neil Schemenauer
64dcbb0c31
[3.13] gh-133122: Fix for test_type_lookup_mro_reference. (gh-133127)
Change the unit test case to use `getattr()` so that we avoid the
bytecode specializer optimizing the access.  The specializer will call
the `__eq__` method before the unit test expects, causing it to fail.

In the 3.14 branch (gh-128164) the test is changed in a different way
to avoid the same issue.
2025-04-29 03:33:13 +00:00
Neil Schemenauer
ca46ec85f8
[3.13] gh-132942: Fix races in type lookup cache (gh-133114)
Two races related to the type lookup cache, when used in the
free-threaded build.  This caused test_opcache to sometimes fail (as
well as other hard to re-produce failures).
2025-04-28 22:08:09 +00:00
Miss Islington (bot)
b71442f44f
[3.13] gh-132742: Fix newly added tcflush() tests on Android (GH-133070) (GH-133104)
(cherry picked from commit 25186c2472)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-04-28 19:10:42 +00:00
sobolevn
ab89f6ec84
[3.13] gh-133054: Skip test_pyrepl tests when cannot use pyrepl is reported (GH-133055) (#133095)
(cherry picked from commit b739ec5ab7)

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2025-04-28 18:00:42 +00:00
Miss Islington (bot)
507b4fa7a4
[3.13] gh-132026: Ensure _MIPS_SIM has defined _ABI identifiers for comparison (GH-133092)
When built on a MIPS architecture, `_MIPS_SIM` is used to determine
architecture specifics. The value is expected to match either
`_ABIO32`, `_ABIN32` or `_ABI64`.

In `gcc` config/mips/mips.h these values are defined as compiler
`builtin_define` inside of a switch/case. That means, mips64el and
mips64 architectures know about `_ABI64` but don't know about `_ABIO32`
and `_ABIN32`. In turn, when CPython tries to use them in comparison,
they may be undefined identifiers.

In default compiler behavior, the undefined identifier will be
evaluated as zero, and it will not match `_MIPS_SIM`. However, the
issues pop up when `-Wundef` (or, even worse, `-Werror=undef`) compiler
flag is enabled. Then suddenly it's visible as a warning or error.
(cherry picked from commit 6985e2e6de)

Co-authored-by: Valters Jansons <sigv@users.noreply.github.com>
2025-04-28 12:15:45 -05:00
Miss Islington (bot)
85882ca0e7
[3.13] gh-132726: Change the heading of sysconfig CLI section (GH-133035) (#133088)
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
2025-04-28 15:19:46 +00:00
Miss Islington (bot)
6ade0c3b2b
[3.13] gh-133033: Add docs for TypeIgnore (GH-133034) (#133078)
gh-133033: Add docs for `TypeIgnore` (GH-133034)
(cherry picked from commit 4e04511cb9)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-04-28 10:55:19 +00:00
Serhiy Storchaka
0d53872443
[3.13] gh-132742: Improve tests for fcntl.ioctl() (GH-132791) (GH-133066)
* Use better tests for integer argument.
* Add also parallel tests for tcflush() and tcflow().
(cherry picked from commit ed8e886f4f)
2025-04-28 08:23:43 +00:00