Commit graph

53815 commits

Author SHA1 Message Date
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
Bénédikt Tran
f12e7cb8b2
[3.13] gh-136134: smtplib: fix CRAM-MD5 on FIPS-only environments (GH-136623) (#138087)
(cherry picked from commit 766614f88a)
(cherry picked from commit ab1bef8ad2)
2025-08-23 14:27:47 +02:00
Bénédikt Tran
3afc263c41
[3.13] gh-136134: imaplib: fix CRAM-MD5 on FIPS-only environments (GH-136615) (#138055)
(cherry picked from commit 4519b8acb5)
2025-08-23 13:01:36 +02:00
Miss Islington (bot)
b9179c354b
[3.13] gh-137754: Fix import of zoneinfo if _datetime is not available (GH-137845) (GH-138085)
Both modules should use the Python implementation in that case.
(cherry picked from commit 6620ef0ff6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-23 09:33:58 +00:00
Miss Islington (bot)
ab8ffc482e
[3.13] gh-135386: Skip readonly tests for the root user (GH-138058) (GH-138064)
(cherry picked from commit 5b0f00e616)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-22 13:44:19 +00:00
Kliment Lamonov
ebccd1de88
[3.13] gh-132744: Check recursion limit in _PY_FRAME_GENERAL (GH-132746) (GH-138032) 2025-08-22 20:25:24 +08:00
Miss Islington (bot)
8f2280272d
[3.13] gh-135386: Fix "unable to open database file" errors on readonly DB (GH-135566) (GH-138057)
Add immutable=1 flag for read-only SQLite access to avoid WAL/SHM errors on readonly DB.
(cherry picked from commit c0ae92b7c0)

Co-authored-by: General_K1ng <generak1ng0@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-22 11:35:21 +00:00
Bénédikt Tran
41c2c8f01c
[3.13] gh-135734: correctly handle --enable-optimizations --disable-test-modules combination (#137998) 2025-08-21 20:28:03 +02:00
Serhiy Storchaka
c04b3de517
[3.13] gh-137477: Fix inspect.getblock() for generator expressions (GH-137488) (GH-137995)
This fixes also inspect.getsourcelines() and inspect.getsource().
(cherry picked from commit eae9d7de1c)
2025-08-20 13:43:28 +00:00
Miss Islington (bot)
b3725651a2
[3.13] gh-134869: Fix Ctrl+C corrupts REPL autocomplete (GH-134929) (#137925)
gh-134869: Fix Ctrl+C corrupts REPL  autocomplete (GH-134929)
(cherry picked from commit 8750e5ecfc)

Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
2025-08-18 22:21:26 +01:00
Miss Islington (bot)
fc2e84feb1
[3.13] gh-123085: _compile_importlib: Avoid copying sources before compilation (GH-124131) (#137914)
gh-123085: _compile_importlib: Avoid copying sources before compilation (GH-124131)
(cherry picked from commit 42c8b0556c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2025-08-18 13:55:44 +00:00
Gregory P. Smith
9face218e7
[3.13] gh-87135: Hang non-main threads that attempt to acquire the GIL during finalization (GH-105805) (GH-137827)
* [3.13] gh-87135: Hang non-main threads that attempt to acquire the GIL during finalization (GH-105805)

Instead of surprise crashes and memory corruption, we now hang threads that attempt to re-enter the Python interpreter after Python runtime finalization has started. These are typically daemon threads (our long standing mis-feature) but could also be threads spawned by extension modules that then try to call into Python. This marks the `PyThread_exit_thread` public C API as deprecated as there is no plausible safe way to accomplish that on any supported platform in the face of things like C++ code with finalizers anywhere on a thread's stack. Doing this was the least bad option.

(cherry picked from commit 8cc5aa47ee)

Co-authored-by: Jeremy Maitin-Shepard <jeremy@jeremyms.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>

* state "3.13.7 and earlier"
* backport: do not add the deprecated marker
* fix Py_IsFinalizing doc ref

---------

Co-authored-by: Jeremy Maitin-Shepard <jeremy@jeremyms.com>
2025-08-17 09:08:14 -07:00
Miss Islington (bot)
f2b7954ce0
[3.13] gh-135661: Fix parsing unterminated bogus comments in HTMLParser (GH-137873) (GH-137875)
Bogus comments that start with "<![CDATA[" should not include the starting "!"
in its value.
(cherry picked from commit 7636a66635)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-17 10:59:24 +00:00
Miss Islington (bot)
8d6e1075da
[3.13] gh-131178: Add tests for site command-line interface (GH-133582) (GH-137833)
gh-131178: Add tests for `site` command-line interface  (GH-133582)
(cherry picked from commit 03f5519d77)

Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
2025-08-15 18:22:46 +00:00
Jason R. Coombs
0607fdd56c
[3.13] gh-123085: Fix issue in inferred caller when resource package has no source (GH-123102) (#124024) 2025-08-15 14:21:16 +00:00
adam j hartz
5131b8fe7e
[3.13] gh-137576: Fix for Basic REPL showing incorrect code in tracebacks with PYTHONSTARTUP (GH-137625) (#137778)
(cherry picked from commit 04f8ef663b)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2025-08-15 12:10:39 +03:00
Miss Islington (bot)
a33596765b
[3.13] gh-135661: Fix CDATA section parsing in HTMLParser (GH-135665) (GH-137773)
"] ]>" and "]] >" no longer end the CDATA section.

Make CDATA section parsing  context depending.
Add private method HTMLParser._set_support_cdata() to change the context.
If called with True, "<[CDATA[" starts a CDATA section which ends with "]]>".
If called with False, "<[CDATA[" starts a bogus comments which ends with ">".
(cherry picked from commit 0cbbfc4621)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-14 21:44:16 +03:00
Thomas Wouters
bcee1c3221 Python 3.13.7 2025-08-14 13:12:11 +02:00
Miss Islington (bot)
d22276dc7d
[3.13] gh-131788: make resource_tracker re-entrant safe (GH-131787) (#137738)
gh-131788: make resource_tracker re-entrant safe (GH-131787)
(cherry picked from commit f24a012350)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-08-14 12:52:30 +02:00
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко)
5d64571b43
[3.13] Update pre-commit hooks (GH-137591) (GH-137641)
(cherry picked from commit b36d23f58e)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-12 13:42:55 +02:00
Miss Islington (bot)
4a630d7b29
[3.13] gh-126008: Improve docstrings for Tkinter cget and configure methods (GH-133303) (GH-137661)
* Explain the behavior of Widget.configure() depending on arguments.
* Unify descriptions.
* Replace "resource" with "option".
(cherry picked from commit 027cacb67c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-12 05:17:24 +00:00
Peter Bierma
da39cb9716
[3.13] gh-137583: Only lock the SSL context, not the SSL socket (GH-137588) (GH-137613)
Fixes a deadlock introduced in 3.13.6.

(cherry picked from commit 55788a9096)
2025-08-11 22:05:13 -04:00
Sam Gross
e236568c0e
[3.13] gh-137400: Fix a crash when disabling profiling across all threads (gh-137471) (gh-137649)
The `PyEval_SetProfileAllThreads` function and other related functions
had a race condition on `tstate->c_profilefunc` that could lead to a
crash when disable profiling or tracing on all threads while another
thread is starting to profile or trace a a call.

There are still potential crashes when threads exit concurrently with
profiling or tracing be enabled/disabled across all threads.
(cherry picked from commit 362692852f)
2025-08-11 16:07:21 +00:00
Miss Islington (bot)
63a9494878
[3.13] Add test for opening an SQLite with bytes path (GH-136331) (GH-137633)
Add test for opening an SQLite with bytes path (GH-136331)
(cherry picked from commit 1bde13b0e9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-11 16:04:54 +03:00
Miss Islington (bot)
23b7a95f41
[3.13] gh-136914: Fix support of cached functions and properties in DocTest's lineno computation (GH-136930) (GH-137615)
Previously, DocTest's lineno of functions and methods decorated with
functools.cache(), functools.lru_cache() and functools.cached_property()
was not properly returned (None was returned) because the
computation relied on inspect.isfunction() which does not consider the
decorated result as a function.

We now use the more generic inspect.isroutine(), as elsewhere
in doctest's logic.

Also, added a special case for functools.cached_property().
(cherry picked from commit fece15d29f)

Co-authored-by: Denis Laxalde <denis@laxalde.org>
2025-08-10 20:05:28 +00:00
Miss Islington (bot)
4ad360353f
[3.13] gh-137412: fix default_builtin_hashes values in test_hashlib.py (GH-137413) (#137535)
gh-137412: fix `default_builtin_hashes` values in `test_hashlib.py` (GH-137413)

fix `default_builtin_hashes` in test_hashlib
(cherry picked from commit deb385a143)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-08-07 22:54:27 +00:00
Guilherme Leobas
16cebe69a8
[3.13] gh-137463: Update validate_abstract_methods in test_collections.py (GH-137464) (#137521)
gh-137463: Update `validate_abstract_methods` in `test_collections.py` (#137464)

Update `validate_abstract_methods` in `test_collections.py`

The test for missing abstract methods in `validate_abstract_methods` incorrectly attempted to instantiate the generated class `C` with an argument (`C(name)`), which always raises a `TypeError: C() takes no arguments`. Although the test originally passes, it passes for the wrong reason.

This change makes the test correctly validate the enforcement of abstract methods in ABCs.

(cherry picked from commit 5be872350d)
2025-08-08 00:29:45 +03:00
Miss Islington (bot)
8905f7a99b
[3.13] gh-137044: Support large limit values in getrlimit() and setrlimit() (GH-137338) (GH-137507)
* Return large limit values as positive integers instead of negative integers
  in resource.getrlimit().
* Accept large values and reject negative values (except RLIM_INFINITY)
  for limits in resource.setrlimit().
(cherry picked from commit baefaa6cba)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-07 09:37:02 +00:00
Thomas Wouters
4e66535108 Python 3.13.6 2025-08-06 15:05:20 +02:00
Miss Islington (bot)
f2d6931656
[3.13] gh-58124: Avoid CP_UTF8 in UnicodeDecodeError (GH-137415) (#137461)
gh-58124: Avoid CP_UTF8 in UnicodeDecodeError (GH-137415)

Fix name of the Python encoding in Unicode errors of the code page
codec: use "cp65000" and "cp65001" instead of "CP_UTF7" and "CP_UTF8"
which are not valid Python code names.
(cherry picked from commit ce1b747ff6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-08-06 12:59:11 +00:00
Miss Islington (bot)
3a61ddf2d3
[3.13] gh-81325: Support path-like objects with streaming TarFile (GH-137188) (#137366)
Co-authored-by: Alexander Urieles <aeurielesn@users.noreply.github.com>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-08-05 22:17:12 +01:00
Sergey B Kirpichev
dc980b0ed6
[3.13] gh-122450: Expand documentation for `Rational and Fraction` (#136800) (#137367)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-05 14:54:31 +01:00
Bénédikt Tran
c489934b26
[3.13] gh-135244: generate UUID random Node ID with a CSPRNG as per RFC 9562, §6.10.3 (GH-135226) (#137408)
* [3.13] gh-135244: generate UUID random Node ID with a CSPRNG as per RFC 9562, §6.10.3 (GH-135226)

This aligns with the recommendations of RFC 9562, Section 6.10, paragraph 3 [1].

[1]: https://www.rfc-editor.org/rfc/rfc9562.html#section-6.10-3.

---------
(cherry picked from commit 1cb7163872)

Co-authored-by: LamentXU <108666168+LamentXU123@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-08-05 09:01:07 +00:00
Miss Islington (bot)
25c221f5e7
[3.13] gh-137397: Skip test_os_open on NetBSD due to indefinite hang (GH-137398) (#137407)
gh-137397: Skip test_os_open on NetBSD due to indefinite hang (GH-137398)
(cherry picked from commit 7f416c8674)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2025-08-05 08:55:53 +00:00
Bénédikt Tran
3c37483731
[3.13] gh-132710: only use stable _uuid.generate_time_safe() to deduce MAC address (GH-132901) (#134704)
This commit includes the original commit and the NEWS entry that was added separately.

(cherry picked from commit 3bffada467)
(cherry picked from commit 9eb84d83e0)
2025-08-05 07:56:03 +00:00
Miss Islington (bot)
932221bc01
[3.13] gh-132124: improve safety nets for creating AF_UNIX socket files (GH-134085) (#134448)
* gh-132124: improve safety nets for creating AF_UNIX socket files (GH-134085)

* ensure that we can create AF_UNIX socket files
* emit a warning if system-wide temporary directory is used
(cherry picked from commit 1a07a01014)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* rename warn -> _warn for the 3.13.x backport

* Update Misc/NEWS.d/next/Library/2025-05-16-12-40-37.gh-issue-132124.T_5Odx.rst

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-08-04 07:38:49 -07:00
Pablo Galindo Salgado
235d380c4c
[3.13] gh-130077: Properly match full soft keywords in the parser (GH-135317) (#135399)
* [3.13] gh-130077: Properly match full soft keywords in the parser (GH-135317)
(cherry picked from commit ff2b5f40c2)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>

* Remove line the main-branch commit removed

---------

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-08-04 15:18:05 +01:00
Miss Islington (bot)
55f8fe548a
[3.13] gh-137194: Fix requires_debug_ranges when _testcpi doesn't exist (GH-137195) (GH-137275)
(cherry picked from commit 0282eef880)

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2025-08-04 13:22:15 +00:00
Brian Schubert
a2c749d806
[3.13] Fix typo in Lib/test/test_ast/test_ast.py (GH-136767) (#137356)
`ASTOptimiziationTests` -> `ASTOptimizationTests`
(cherry picked from commit 60146f4f6f)

Co-authored-by: Hunter Hogan <hunterhogan@users.noreply.github.com>
2025-08-04 08:56:07 +03:00