Commit graph

53803 commits

Author SHA1 Message Date
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
Miss Islington (bot)
1ba09b2f04
[3.13] gh-137257: Upgrade bundled pip to 25.2 (GH-137258) (GH-137362)
gh-137257: Upgrade bundled pip to 25.2 (GH-137258)
(cherry picked from commit 506542b596)

Co-authored-by: Richard Si <sichard26@gmail.com>
2025-08-04 02:23:25 +00:00
Brian Schubert
d29a9c55cf
[3.13] Doc: fix duplicated words (GH-136086) (#137357)
(cherry picked from commit 698bab5a40)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-08-04 06:41:47 +08:00
Serhiy Storchaka
1c96723cb1
[3.13] gh-137341: Remove more word duplications (GH-137342) (GH-137347)
(cherry picked from commit 1612dcbafe)
2025-08-03 17:24:26 +00:00
Miss Islington (bot)
23a3e892ee
[3.13] gh-137314: Fix incorrect treatment of format specs in raw fstrings (GH-137328) (#137345)
gh-137314: Fix incorrect treatment of format specs in raw fstrings (GH-137328)
(cherry picked from commit 0153d82a5a)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-08-03 16:58:49 +00:00
Miss Islington (bot)
1b0dfbf209
[3.13] gh-135444: fix asyncio.DatagramTransport.sendto to account for datagram header size when data cannot be sent (GH-135445) (#137246)
gh-135444: fix `asyncio.DatagramTransport.sendto` to account for datagram header size when data cannot be sent (GH-135445)
(cherry picked from commit e3ea861351)

Co-authored-by: Justin Bronder <jsbronder@cold-front.org>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-08-03 10:18:53 +05:30
Miss Islington (bot)
a32bd11cb0
[3.13] gh-137273: Fix debug assertion failure in locale.setlocale() on Windows (GH-137300) (GH-137306)
It happened when there were at least 16 characters after dot in the
locale name.
(cherry picked from commit 718e0c89ba)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-01 15:06:16 +00:00
Miss Islington (bot)
d3b5f838ec
[3.13] GH-116738: document thread-safety of bisect (GH-136555) (#137222)
* GH-116738: document thread-safety of bisect (GH-136555)
(cherry picked from commit 5236b0281b)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-07-30 11:50:39 +00:00
Miss Islington (bot)
cdae923ffe
[3.13] gh-130577: tarfile now validates archives to ensure member offsets are non-negative (GH-137027) (#137170)
gh-130577: tarfile now validates archives to ensure member offsets are non-negative (GH-137027)
(cherry picked from commit 7040aa54f1)

Co-authored-by: Alexander Urieles <aeurielesn@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-07-28 15:59:33 +00:00
Gregory P. Smith
4a37dd6cef
[3.13] gh-134698: Hold a lock when the thread state is detached in ssl (GH-134724) (#137126)
Lock when the thread state is detached.
(cherry picked from commit e047a35b23) or really from the 3.14 backport fd565fdfc9

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-07-27 08:30:25 -07:00
Miss Islington (bot)
a995a11b23
[3.13] gh-131038: Use text=True in subprocesses in test_perf_profiler (GH-137117) (#137125) 2025-07-26 17:24:32 +00:00
Miss Islington (bot)
8f4121168a
[3.13] gh-130522: Fix unraisable TypeError in threading at interpreter shutdown (GH-131537) (GH-137106)
gh-130522: Fix unraisable TypeError in threading at interpreter shutdown (GH-131537)
(cherry picked from commit cb93b6fc5e)

Co-authored-by: Tyler Kennedy <tk@tkte.ch>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-07-25 15:14:27 +00:00
Miss Islington (bot)
eda613438f
[3.13] Fix Queue.shutdown docs for condition to unblock a join (gh-137088) (gh-137102) 2025-07-25 08:48:28 -06:00