Commit graph

53853 commits

Author SHA1 Message Date
Miss Islington (bot)
6bdd9e2705
[3.13] gh-138854: Skip test_script_shadowing_stdlib_cwd_failure on AIX (GH-138855) (GH-139675)
gh-138854: Skip test_script_shadowing_stdlib_cwd_failure on AIX (GH-138855)
(cherry picked from commit 171f787a29)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2025-10-06 18:05:07 +00:00
Miss Islington (bot)
7816ac344c
[3.13] gh-133210: Fix test_inspect without docstrings (GH-139651) (#139670)
gh-133210: Fix `test_inspect` without docstrings (GH-139651)
(cherry picked from commit 7c70cc5c23)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-10-06 17:13:08 +00:00
Miss Islington (bot)
a35e870861
[3.13] gh-133210: Fix test_pydoc without docstrings (GH-139654) (#139666)
gh-133210: Fix `test_pydoc` without docstrings (GH-139654)
(cherry picked from commit 708de26e31)

Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
2025-10-06 15:14:04 +00:00
Sebastian Pipping
69ab8fbb85
[3.13] gh-139400: Make sure that parent parsers outlive their subparsers in pyexpat (GH-139403) (GH-139608)
Within libexpat, a parser created via `XML_ExternalEntityParserCreate`
is relying on its parent parser throughout its entire lifetime.
Prior to this fix, is was possible for the parent parser to be
garbage-collected too early.

(cherry picked from commit 6edb2ddb5f)
2025-10-06 15:17:37 +02:00
Miss Islington (bot)
52c0738700
[3.13] gh-139624: Skip problematic locales on AIX in test_date_locale2 (GH-139625) (GH-139645)
(cherry picked from commit 6f3dae0dc5)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2025-10-06 13:49:50 +03:00
Miss Islington (bot)
d3a4e0608b
[3.13] gh-137242: Allow Android testbed to take all Python command-line options (GH-138805) (#139638)
Modifies the Android test runner to ensure that all valid Python command line
options are preserved when running the test suite.
(cherry picked from commit a9b0506d8d)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-10-06 06:25:58 +00:00
Miss Islington (bot)
7e5d47de10
[3.13] gh-139310: skip test_aead_aes_gcm for Linux kernel between 6.16.0 and 6.17.x (GH-139552) (#139593)
gh-139310: skip `test_aead_aes_gcm` for Linux kernel between 6.16.0 and 6.17.x (GH-139552)

Currently, Fedora 42 uses a custom Linux Kernel 6.16.9 that backported an upstream change
from 6.17-rc7 [1,3] but not its subsequent fix [2]. Until the issue is resolved upstream,
we skip the failing test `test_socket.test_aead_aes_gcm` for kernel versions between 6.16
and 6.17.x.

[1] 1b34cbbf4f
[2] d0ca0df179
[3] 45bcf60fe4
(cherry picked from commit 41712c4e09)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-05 08:52:06 +00:00
Miss Islington (bot)
be388836c0
[3.13] gh-138703: clarify data buffer requirement of asyncio.StreamWriter.write (GH-139564) (#139571)
gh-138703: clarify data buffer requirement of `asyncio.StreamWriter.write` (GH-139564)
(cherry picked from commit 0b2168275e)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-04 22:12:03 +05:30
Victor Stinner
a75676bf6c
[3.13] gh-135329: Use longer timeout in pyrepl test_repl_eio() (#139503) (#139507)
gh-135329: Use longer timeout in pyrepl test_repl_eio() (#139503)

Replace hardcoded 5 seconds with support.SHORT_TIMEOUT.

Fix the following error on slow CI such as GitHub Action UBSan:

test test_pyrepl failed -- Traceback (most recent call last):
  File "Lib/test/test_pyrepl/test_unix_console.py", line 362, in test_repl_eio
    _, err = proc.communicate(timeout=5)  # sleep for pty to settle
             ~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "Lib/subprocess.py", line 1219, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
                     ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Lib/subprocess.py", line 2126, in _communicate
    self._check_timeout(endtime, orig_timeout, stdout, stderr)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Lib/subprocess.py", line 1266, in _check_timeout
    raise TimeoutExpired(
    ...<2 lines>...
            stderr=b''.join(stderr_seq) if stderr_seq else None)
subprocess.TimeoutExpired: Command '[...]' timed out after 5 seconds

(cherry picked from commit c985822d86)
2025-10-02 15:08:42 +00:00
Miss Islington (bot)
f48128b6b3
[3.13] gh-139210: Fix use-after-free in xml.etree.ElementTree.iterparse() (GH-139211) (GH-139456)
(cherry picked from commit c86eb4d3ac)

Co-authored-by: Ken Jin <kenjin@python.org>
2025-09-30 18:14:44 +00:00
Miss Islington (bot)
0ef302e019
[3.13] gh-130567: Enable previously skipped locale tests on FreeBSD and macOS (GH-138652) (GH-139422)
(cherry picked from commit 1b8dcdacc7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-30 17:53:45 +02:00
Miss Islington (bot)
d232944638
[3.13] gh-78319: Fix implementation of IMAP APPEND UTF8 (GH-9436) (GH-139407)
gh-78319: Fix implementation of IMAP APPEND UTF8 (GH-9436)

Make UTF8 support for the IMAP APPEND command RFC 6855 compliant.
(cherry picked from commit 408154d64a)

Co-authored-by: Gordon Messmer <gordon.messmer@gmail.com>
2025-09-29 06:25:51 +00:00
Tian Gao
773a7c05ff
[3.13] gh-139289: Lazy import rlcompleter to fix the refleak (GH-139305) (#139357)
(cherry picked from commit 8288f3693f)
2025-09-26 22:50:33 +08:00
Tian Gao
dbe4690772
[3.13] gh-138860: Lazy import rlcompleter in pdb to avoid deadlock in… (#139281)
[3.13] gh-138860: Lazy import rlcompleter in pdb to avoid deadlock in subprocess (GH-139185)
(cherry picked from commit c8624cd367)
2025-09-24 14:07:50 +08:00
Miss Islington (bot)
096772dd5d
[3.13] gh-139208: Fix regrtest --fast-ci --verbose (GH-139240) (#139261)
gh-139208: Fix regrtest --fast-ci --verbose (GH-139240)

Don't ignore the --verbose option anymore.
(cherry picked from commit dd683f8f34)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-09-23 14:32:19 +00:00
Alex Waygood
8aa856170d
[3.13] gh-118803: Fixup a few references in the 3.13 branch to the intended removal date for ByteString (#139171) 2025-09-19 18:51:39 +01:00
Peter Bierma
63dd27da3b
[3.13] gh-112729: Correctly fail when the process is out of memory during interpreter creation (GH-139164) (GH-139169)
* gh-112729: Correctly fail when the process is out of memory during interpreter creation (GH-139164)

(cherry picked from commit d06113c7a7)
2025-09-19 15:09:44 +00:00
Miss Islington (bot)
9809c30456
[3.13] gh-139076: Fix regression in pydoc not showing extension functions (GH-139077) (GH-139161)
Fix a bug in the pydoc module that was hiding functions in a Python
module if they were implemented in an extension module and the module did
not have __all__.
(cherry picked from commit 7257b24140)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-19 16:38:20 +03:00
Alex Waygood
8246e25ef0
[3.13] gh-118803: Improve documentation around ByteString deprecation (#139115) (#139137) 2025-09-18 19:35:30 +01:00
Miss Islington (bot)
7de5d02b30
[3.13] gh-82916: Don't fail when importing from / with sys.pycache_prefix set (GH-30456) (GH-137905)
(cherry picked from commit d8a9466e29)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-18 15:37:39 +02:00
Petr Viktorin
135198dd5d
[3.13] gh-138008: Fix segfaults in _ctypes due to invalid argtypes (GH-138285) (#138746)
(cherry picked from commit 1ce05537a3)

Signed-off-by: Nguyen Viet Dung <29406816+magnified103@users.noreply.github.com>
Signed-off-by: Nguyen Viet Dung <dung@ekluster.com>
Co-authored-by: Dung Nguyen <dung@ekluster.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
2025-09-18 12:46:05 +01:00
Miss Islington (bot)
5e59aef20f
[3.13] Make Android streams respect the unbuffered (-u) option (GH-138806) (#139110)
Android pipes stdout/stderr to the log, which means every write to the log
becomes a separate log line. As a result, most practical uses of stdout/stderr
should be buffered; but it doesn't hurt to preserve unbuffered handling in case
it's useful.
(cherry picked from commit 0ac377ff23)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-09-18 12:45:03 +01:00
Łukasz Langa
3db6d82a4d
[3.13] gh-134466: Don't run when termios is inaccessible (GH-138911) (GH-139030)
Without the ability to set required capabilities, the REPL cannot
function properly (syntax highlighting and multiline editing can't
work).

We refuse to work in this degraded state.
(cherry picked from commit 2fc7004d54)
2025-09-17 18:25:40 +02:00
Miss Islington (bot)
b0aa4f252e
[3.13] Synced docs and docstring for sysconfig.get_platform (GH-135530) (#138975)
(cherry picked from commit 01cc53295c)

Co-authored-by: ivan <ivandietert@gmail.com>
Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
Co-authored-by: Ned Deily <nad@python.org>
2025-09-17 13:22:36 +00:00
Łukasz Langa
35ba6d4035
[3.13] gh-135329: prevent infinite traceback loop on Ctrl-C for strace (#138974)
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: dura0ok <slpmcf@gmail.com>
Co-authored-by: graymon <greyschwinger@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit b9dbf6acb3)
2025-09-16 15:17:36 +02:00
Miss Islington (bot)
2b8ff3ca66
[3.13] gh-138163: skip failures if tests are run with SCHED_BATCH on glibc (GH-138576) (GH-138819)
(cherry picked from commit 492941459a)


This backport omits SCHED_DEADLINE, which was added in 3.14.

---------

Co-authored-by: jxes993409 <68891412+jxes993409@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-09-16 10:27:19 +02:00
Łukasz Langa
3669efb890
[3.13] gh-128636: Fix crash in PyREPL when os.environ is overwritten with an invalid value for macOS (GH-138089) (GH-138942)
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

(cherry picked from commit 8ef7735c53)
2025-09-16 00:53:51 +02:00
Miss Islington (bot)
7452e95d09
[3.13] gh-131189: Fix "msvcrt" import warning on Linux when "_ctypes" is not available. (GH-131201) (GH-138934)
gh-131189: Fix "msvcrt" import warning on Linux when "_ctypes" is not available. (GH-131201)

Fix "msvcrt" import warning on Linux when "_ctypes" is not available.

On Linux, compiling without "libffi" causes a
"No module named 'msvcrt'" warning when launching PyREPL.
(cherry picked from commit f320c951c3)

Co-authored-by: Dzmitry Plashchynski <plashchynski@gmail.com>
2025-09-15 18:29:33 +02:00
Miss Islington (bot)
d8d11d50bf
[3.13] gh-138669: Increase test coverage for difflib (GH-138670) (#138818)
gh-138669: Increase test coverage for difflib (GH-138670)
(cherry picked from commit 44991619ba)

Co-authored-by: Jan-Eric Nitschke <47750513+JanEricNitschke@users.noreply.github.com>
2025-09-14 19:42:05 +00:00
Stan Ulbrych
0b302280af
[3.13] gh-71648: Optimize PNG files (GH-138842) (#138852)
* Only keep > 1 kb savings
(cherry picked from commit 2e8f64c931)
2025-09-14 08:29:59 -07:00
Peter Bierma
e7720612ea
[3.13] gh-138479: Ensure that __typing_subst__ returns a tuple (GH-138482) (GH-138786)
* gh-138479: Ensure that `__typing_subst__` returns a tuple (GH-138482)

Raise an exception if __typing_subst__ returns a non-tuple object.

(cherry picked from commit 1da989be74)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-11 11:08:57 +00:00
Miss Islington (bot)
7195d7f3d4
[3.13] gh-71810: Fix corner case (length==0) for int.to_bytes() (GH-138739) (#138783)
gh-71810: Fix corner case (length==0) for int.to_bytes() (GH-138739)

```pycon
>>> (0).to_bytes(0, 'big', signed=True)
b''
>>> (-1).to_bytes(0, 'big', signed=True)  # was b''
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    (-1).to_bytes(0, 'big', signed=True)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
OverflowError: int too big to convert
```
(cherry picked from commit 011179a79a)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-11 10:53:27 +00:00
Serhiy Storchaka
72b28cad91
[3.13] gh-138432: Improved invalid path checking in zoneinfo.reset_tzpath() (GH-138433) (GH-138778)
* Improve error messages for path-like relative paths and path-like bytes paths.
* TZPATH is now always a tuple of strings.
(cherry picked from commit 859aecc33b)

Co-authored-by: Stephen Morton <git@tungol.org>
2025-09-11 07:35:39 +00:00
yihong
afec6a5460
[3.13] gh-134163: Fix an infinite loop when the process runs out of memory in a try block (GH-138491)
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-09-10 12:54:42 -04:00
sobolevn
2422e81e99
[3.13] gh-138729: Cover inspect.formatannotationrelativeto with tests (GH-138730) (#138748)
(cherry picked from commit f5fa336579)
2025-09-10 14:42:49 +00:00
Miss Islington (bot)
7d724708bf
[3.13] gh-90548: Skip NODEV portion of test_makedev when linked to musl (GH-138713)
(cherry picked from commit bbe00d53e9)
2025-09-09 20:01:53 +00:00
Russell Keith-Magee
85649b769f
[3.13] gh-137242: Add a --no-randomize option, and use it in Android CI (GH-138649) (#138685)
Adds a --no-randomize option to the CI runner, so that randomisation can be easily
disabled for --fast-ci and --slow-ci configurations on single-threaded testing platforms
like Android, iOS, and Emscripten.

---------
(cherry picked from commit 01895d233b)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-09-09 10:53:01 +02:00
Gregory P. Smith
9a6137ad4b
[3.13] gh-126631: gh-137996: fix pre-loading of __main__ (GH-135295) (#138609)
gh-126631: gh-137996: fix pre-loading of `__main__`

The `main_path` parameter was renamed `init_main_from_name`, update the
forkserver code accordingly.  This was leading to slower startup times when people
were trying to preload the main module.

---------
(cherry picked from commit 0912b3a6db)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
2025-09-08 11:13:23 -07:00
sobolevn
d3b6bb1125
[3.13] gh-105487: Fix __dir__ entries of GenericAlias (GH-138578) (#138640)
(cherry picked from commit b0420b505e)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-09-08 10:03:03 +00:00
Miss Islington (bot)
614c493406
[3.13] gh-138584: Increase test coverage for collections.UserList (GH-138590) (#138611)
gh-138584: Increase test coverage for `collections.UserList` (GH-138590)

Some common tests in `test.list_tests.CommonTest` explicitly tested `list`
instead of testing the underlying list-like type defined in `type2test`.

---------
(cherry picked from commit d7b9ea5cab)

Co-authored-by: dbXD320 <devanshbaghla320@gmail.com>
Co-authored-by: Devansh Baghla <devanshbaghla34@gmail.com>
2025-09-07 09:52:35 +00:00
Miss Islington (bot)
612b535e6d
[3.13] gh-118981: multiprocessing.popen_spawn_posix, fix potential hang (gh-118982) (#138606)
gh-118981: multiprocessing.popen_spawn_posix, fix potential hang (gh-118982)

fix potential hang.

It can happen that the child crashes right in the beginning for whatever reason. In this case, the parent will hang when writing into the pipe, because the child fd is not closed yet.

The normal pattern is to close the child fds right after the child proc is forked/executed/spawned, so when the child dies, then also the pipes will be closed, and there will be no hang (the parent gets SIGPIPE instead).
(cherry picked from commit 8ed5a2b56c)

Co-authored-by: Albert Zeyer <albzey@gmail.com>
2025-09-07 07:41:54 +00:00
Brian Schubert
cf62144f45
[3.13] gh-138010: Fix __init_subclass__ forwarding by warnings.deprecated (GH-138210) (#138564)
(cherry picked from commit e2c038f5be)
2025-09-05 14:21:19 -07:00
Miss Islington (bot)
509ea397fb
[3.13] gh-88375, gh-111788: Fix parsing errors and normalization in robotparser (GH-138502) (GH-138549)
* Don't fail trying to parse weird patterns.
* Don't fail trying to decode non-UTF-8 "robots.txt" files.
* No longer ignore trailing "?" in patterns and URLs.
* Distinguish raw special characters "?", "=" and "&" from the
  percent-encoded ones.
* Remove tests that do nothing.
(cherry picked from commit cb7ef18d70)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-05 20:21:02 +00:00
Miss Islington (bot)
b5017de2e7
[3.13] gh-95844: Move help_url code to a help module function (GH-129971) (#138485)
gh-95844: Move help_url code to a help module function (GH-129971)

---------
(cherry picked from commit 3b4cd88563)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-09-03 21:49:29 +00:00
Miss Islington (bot)
06dbf81a56
[3.13] gh-138204: Forbid expansion of a shared anonymous mmap on Linux (GH-138220) (GH-138387)
This is a Linux kernel bug which caused a bus error.
https://bugzilla.kernel.org/show_bug.cgi?id=8691
(cherry picked from commit 33fcb0c4a0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-03 11:33:08 +03:00
Miss Islington (bot)
a8460a285a
[3.13] gh-136599: Add tests for long_hash (GH-138335) (#138391)
gh-136599: Add tests for long_hash (GH-138335)
(cherry picked from commit 2d3711dc06)

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-09-02 17:04:13 +00:00
Miss Islington (bot)
f6536d48cd
[3.13] gh-137317: Fix inspect.signature() for class with wrapped __init__ or __new__ (GH-137862) (GH-138225)
Fixed several cases where __init__, __new__ or metaclass` __call__ is a descriptor
that returns a wrapped function.
(cherry picked from commit 025a2135ef)

Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
2025-08-28 16:10:06 +00:00
Miss Islington (bot)
cdafa05fd5
[3.13] gh-71679: Improve tests for repr() of bytes and bytearray (GH-138180) (GH-138183)
* Merge existing tests test_repr_str and test_to_str.
* Add more tests for non-printable and non-ASCII bytes.
* Add tests for special escape sequences ('\t\n\r').
* Add tests for slashes.
* Add more tests for quotes.
* Add tests for subclasses.
* Add test for non-ASCII class name.
* Only apply @check_bytes_warnings for str() tests.
(cherry picked from commit 0dbbf61cc2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-27 10:46:33 +00:00
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко)
f75fc9a780
[3.13] Lint: Create a project-wide `.ruff.toml` settings file (GH-133124) (#137670)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-25 14:38:16 +03:00
Miss Islington (bot)
7e4afe0d52
[3.13] gh-138081: Fix/remove incorrect links in idlelib/HISTORY.txt (GH-138091) (#138125)
gh-138081: Fix/remove incorrect links in `idlelib/HISTORY.txt` (GH-138091)
(cherry picked from commit be24ff0b57)

Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
2025-08-25 02:10:51 +00:00