Commit graph

32680 commits

Author SHA1 Message Date
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)
8de88e0840
[3.13] gh-118350: Fix support of elements "textarea" and "title" in HTMLParser (GH-135310) (GH-136985)
(cherry picked from commit 4d02f31cdd)

Co-authored-by: Timon Viola <44016238+timonviola@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
2025-07-22 14:17:59 +02:00
Miss Islington (bot)
853b5c43d0
[3.13] gh-135661: Fix parsing attributes with whitespaces around the "=" separator in HTMLParser (GH-136908) (GH-136918)
This fixes a regression introduced in GH-135930.
(cherry picked from commit dee6501894)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-22 11:56:10 +02:00
Lysandros Nikolaou
c1085a0a93
[3.13] gh-135148: Correctly handle f/t strings with comments and debug expressions (#135198) (#136899)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-07-21 16:54:29 +02:00
Miss Islington (bot)
cc8b9d6939
[3.13] gh-130655: gettext: Add fallback testcase (GH-136857) (#136863)
gh-130655: gettext: Add fallback testcase (GH-136857)
(cherry picked from commit c6e6fe92cd)

Co-authored-by: Dominic H <dom@dominic.sk>
2025-07-20 12:30:09 +00:00
Miss Islington (bot)
2a6617de48
[3.13] gh-130664: support '_' (just as ',') in Decimal's formatting (GH-132155) (#136649)
gh-130664: support '_' (just as ',') in Decimal's formatting (GH-132155)
(cherry picked from commit e10fe81cc6)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-07-14 14:01:49 +02:00
Duane Griffin
2383c6015c
[3.13] gh-127971: fix off-by-one read beyond the end of a string during search (#132574) (#136648)
(cherry picked from commit 85ec3b3b50)
2025-07-14 11:50:22 +02:00
Miss Islington (bot)
c4386499f6
[3.13] gh-136523: Fix wave.Wave_write emitting an unraisable when open raises (GH-136529) (GH-136607)
(cherry picked from commit 171de05b48)

Co-authored-by: Sachin Shah <39803835+inventshah@users.noreply.github.com>
2025-07-13 06:13:01 +00:00
Miss Islington (bot)
d733a1ed77
[3.13] gh-136549: Fix signature of threading.excepthook() (GH-136559) (GH-136590)
(cherry picked from commit be2c3d284e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-12 16:16:19 +00:00
Bénédikt Tran
360540fd47
[3.13] gh-91153: prevent a crash in bytearray.__setitem__(ind, ...) when ind.__index__ has side-effects (GH-132379) (#136582)
(cherry picked from commit 5e1e21dee3)

Co-authored-by: Bast <52266665+bast0006@users.noreply.github.com>
2025-07-12 16:34:45 +02:00
Miss Islington (bot)
6176101b4a
[3.13] gh-134759: fix UnboundLocalError in email.message.Message.get_payload (GH-136071) (#136580)
gh-134759: fix `UnboundLocalError` in `email.message.Message.get_payload` (GH-136071)
(cherry picked from commit 25335d297b)

Co-authored-by: Kliment Lamonov <klimentlamonov@yandex.ru>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-07-12 13:52:54 +00:00
sobolevn
a2140fad71
[3.13] gh-136438: Make sure test_builtins pass with all optimization levels (GH-136474) (#136502)
(cherry picked from commit c176543349)
2025-07-10 11:17:20 +00:00
Miss Islington (bot)
4a889d8436
[3.13] gh-136297: Fix hypothesis and subTest usage in test_zoneinfo_property.py (GH-136384) (#136408)
gh-136297: Fix `hypothesis` and `subTest` usage in `test_zoneinfo_property.py` (GH-136384)
(cherry picked from commit db699db99d)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-08 08:14:14 +00:00
Miss Islington (bot)
eea2af3dd8
[3.13] gh-124486: Fix test_whichdb_ndbm in test_dbm on NetBSD (GH-136335) (GH-136379)
On NetBSD, ndbm.open() does not fail for empty file.
(cherry picked from commit b7aa2a4b4d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-07 12:50:40 +00:00
Miss Islington (bot)
4f24dc0ea8
[3.13] gh-136289: Fix test_sqlite3 on platforms with strict UTF-8 filesystem (GH-136326) (GH-136351)
(cherry picked from commit 85b817da94)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-07 12:43:22 +03:00
Miss Islington (bot)
b22c8be18a
[3.13] gh-136297: Test all pickle protocols in test_zoneinfo_property.py (GH-136298) (#136312)
gh-136297: Test all `pickle` protocols in `test_zoneinfo_property.py` (GH-136298)
(cherry picked from commit 5de7e3f973)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-05 06:36:41 +00:00
Miss Islington (bot)
7038e4a243
[3.13] gh-102555: Fix comment parsing in HTMLParser according to the HTML5 standard (GH-135664) (GH-136272)
* "--!>" now ends the comment.
* "-- >" no longer ends the comment.
* Support abnormally ended empty comments "<-->" and "<--->".

---------
(cherry picked from commit 8ac7613dc8)

Co-author: Kerim Kabirov <the.privat33r+gh@pm.me>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2025-07-04 07:22:33 +00:00
Miss Islington (bot)
b041a456f1
[3.13] gh-135661: Fix parsing start and end tags in HTMLParser according to the HTML5 standard (GH-135930) (GH-136256)
* Whitespaces no longer accepted between `</` and the tag name.
  E.g. `</ script>` does not end the script section.

* Vertical tabulation (`\v`) and non-ASCII whitespaces no longer recognized
  as whitespaces. The only whitespaces are `\t\n\r\f `.

* Null character (U+0000) no longer ends the tag name.

* Attributes and slashes after the tag name in end tags are now ignored,
  instead of terminating after the first `>` in quoted attribute value.
  E.g. `</script/foo=">"/>`.

* Multiple slashes and whitespaces between the last attribute and closing `>`
  are now ignored in both start and end tags. E.g. `<a foo=bar/ //>`.

* Multiple `=` between attribute name and value are no longer collapsed.
  E.g. `<a foo==bar>` produces attribute "foo" with value "=bar".

* Whitespaces between the `=` separator and attribute name or value are no
  longer ignored. E.g. `<a foo =bar>` produces two attributes "foo" and
  "=bar", both with value None; `<a foo= bar>` produces two attributes:
  "foo" with value "" and "bar" with value None.

---------
(cherry picked from commit 0243f97cba)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2025-07-03 21:07:40 +00:00
Miss Islington (bot)
c30178a295
[3.13] gh-130664: Treat '0' fill character with align '=' as zero-padding for Fraction's (GH-131067) (GH-136242)
(cherry picked from commit c113a8e523)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-07-03 11:20:49 +00:00
Miss Islington (bot)
1de8fc3e4b
[3.13] gh-135640: Adds more type checking to ElementTree (GH-135643) (GH-136226)
(cherry picked from commit e0245c789f)

Co-authored-by: Kira <kirawhoprograms@fastmail.com>
2025-07-03 08:12:21 +00:00
Miss Islington (bot)
d80df8c1a5
[3.13] gh-135836: Fix IndexError in asyncio.create_connection() (GH-135875) (#136222)
gh-135836: Fix `IndexError` in `asyncio.create_connection()` (GH-135875)
(cherry picked from commit 9084b15156)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-03 04:31:43 +00:00
Miss Islington (bot)
1994d2e5b1
[3.13] gh-135836: Fix IndexError in asyncio.create_connection with empty exceptions list (GH-135845) (#136168)
gh-135836: Fix `IndexError` in `asyncio.create_connection` with empty exceptions list (GH-135845)
(cherry picked from commit 0e19db653d)

Co-authored-by: heliang666s <147408835+heliang666s@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-07-03 09:37:28 +05:30
Miss Islington (bot)
da2c4ef7eb
[3.13] gh-87298: Add tests for find_in_strong_cache() bug in _zoneinfo (GH-24829) (GH-136182)
(cherry picked from commit 12ce16bc13)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Paul Ganssle <p.ganssle@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-01 15:19:39 +00:00
Miss Islington (bot)
1e3466a1ae
[3.13] gh-133982: Use implementation-specific open in test_fileio.OtherFileTests (GH-135364) (GH-136149)
gh-133982: Use implementation-specific `open` in `test_fileio.OtherFileTests` (GH-135364)
(cherry picked from commit 23caccf74c)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-06-30 22:19:14 +00:00
Miss Islington (bot)
4f4fa72695
[3.13] gh-85702: Catch IsADirectoryError in zoneinfo (GH-131333) (#136130)
gh-85702: Catch IsADirectoryError in zoneinfo (GH-131333)
(cherry picked from commit d22604a6d1)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-30 15:00:56 +00:00
Victor Stinner
b5fafc3ab9
[3.13] gh-128051: Fix tests if sys.float_repr_style is 'legacy' (#135908) (#136026)
gh-128051: Fix tests if sys.float_repr_style is 'legacy' (#135908)


(cherry picked from commit f3aec60d7a)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-06-30 11:40:06 +02:00
Bénédikt Tran
d3bcecdcdb
[3.13] gh-135571: Guard _hashlib usage in test_hashlib.py (GH-135572) (#136041)
(cherry picked from commit 065194c1a9)

Co-authored-by: Will Childs-Klein <willck93@gmail.com>
2025-06-28 10:15:49 +02:00
Miss Islington (bot)
e7a8f9664a
[3.13] gh-136028: Fix parsing month names containing "İ" (U+0130) in strptime() (GH-136029) (GH-136038)
This affects locales az_AZ, ber_DZ, ber_MA and crh_UA.
(cherry picked from commit 731f5b8ab3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-27 14:10:51 +00:00
Serhiy Storchaka
3576e1a954
[3.13] gh-78465: Fix error message for cls.__new__(cls, ...) where cls is not instantiable (GH-135981) (GH-136031)
Previous error message suggested to use cls.__new__(), which
obviously does not work. Now the error message is the same as for
cls(...).
(cherry picked from commit c45f4f3ebe)
2025-06-27 12:07:22 +00:00
Miss Islington (bot)
ea25f4a8ec
[3.13] gh-53203: Fix strptime() for %c, %x and %X formats on some locales (GH-135971) (GH-136020)
* Add detection of decimal non-ASCII alt digits.
* Add support of non-decimal alt digits on locale lzh_TW.
* Accept only numbers in correct range if alt digits are known.
* Fix bug in detecting the position of the week day name on locales byn_ER and wal_ET.
* Fix support of single-digit hour on locales ar_SA and bg_BG.
* Add support for %T, %R, %r, %C, %OC.
* Prepare code to use nl_langinfo().

(cherry picked from commit 07183ebce3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-27 08:12:58 +00:00
Miss Islington (bot)
c148a68efe
[3.13] gh-91555: Revert disabling of logger while handling log record. (GH-135858) (GH-135911)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2025-06-25 19:24:55 +01:00
Brian Schubert
3e4362812e
[3.13] gh-135855: Raise TypeError When Passing Non-dict Object to _interpreters.set___main___attrs (gh-135903)
(cherry picked from commit 4e6f0d116e, AKA gh-135856)
2025-06-24 16:23:26 -06:00
Miss Islington (bot)
86d1821ef1
[3.13] gh-135487: fix reprlib.Repr.repr_int when given very large integers (GH-135506) (#135886)
gh-135487: fix `reprlib.Repr.repr_int` when given very large integers (GH-135506)
(cherry picked from commit e5f03b94b6)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-24 12:00:14 +00:00
Victor Stinner
a27398d5b3
[3.13] gh-135494: Fix python -m test --pgo -x test_re (#135713) (#135881)
gh-135494: Fix python -m test --pgo -x test_re (#135713)

Fix regrtest to support excluding tests from --pgo tests.

(cherry picked from commit 15c6d63fe6)
2025-06-24 10:49:31 +00:00
Eric Snow
666795ae34
[3.13] gh-135698: Fix Cross-interpreter Queue.full() With Negative/Default max_size (gh-135778)
We weren't handling non-positive maxsize values (including the default) properly
in Queue.full().  This change fixes that and adjusts an associated assert.

(cherry picked from commit c5ea8e8, AKA gh-135724)
2025-06-23 19:38:41 +00:00
Miss Islington (bot)
3e81d56a1b
[3.13] gh-134986: Catch PermissionError when trying to call perf in tests (GH-134987) (#135842)
gh-134986: Catch PermissionError when trying to call perf in tests (GH-134987)

Using Ubuntu 24.04 on the Windows Subsystem for Linux, perf will raise a
`PermissionError` instead of `FileNotFoundError`. This commit modifies
the tests to catch that.
(cherry picked from commit 6ab842fce5)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-06-23 10:51:51 +00:00
Miss Islington (bot)
6e0ad71a29
[3.13] gh-135815: skip netrc security checks if os.getuid is missing (GH-135816) (#135826)
gh-135815: skip `netrc` security checks if `os.getuid` is missing (GH-135816)
(cherry picked from commit b57b619e34)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-22 20:12:20 +00:00
Miss Islington (bot)
55a34a1d16
[3.13] gh-126112: Fix test_os.TimerfdTests: use 10 ms resolution (GH-135681) (#135705)
gh-126112: Fix test_os.TimerfdTests: use 10 ms resolution (GH-135681)

Use 10 ms for CLOCK_RES instead of 100 ms to tolerate slow buildbots.
(cherry picked from commit 5c25c884b9)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-19 10:04:48 +00:00
Miss Islington (bot)
a0a1aa3125
[3.13] gh-135335: flush stdout/stderr in forkserver after preloading modules (GH-135338) (#135671)
gh-135335: flush stdout/stderr in forkserver after preloading modules (GH-135338)

If a preloaded module writes to stdout or stderr, and the stream is buffered,
child processes will inherit the buffered data after forking. Attempt to
prevent this by flushing the streams after preload.
(cherry picked from commit 9877d191f4)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-18 12:40:21 +00:00
Miss Islington (bot)
28a70a59e4
[3.13] gh-135489: Show verbose output for failing tests during PGO profiling step with --enable-optimizations (#135600)
Co-authored-by: PuQing <me@puqing.work>
2025-06-17 01:47:27 -04:00
Sam Gross
f33a5e891a
[3.13] gh-132617: Fix dict.update() mutation check (gh-134815) (gh-135582)
Use `ma_used` instead of `ma_keys->dk_nentries` for modification check
so that we only check if the dictionary is modified, not if new keys are
added to a different dictionary that shared the same keys object.
(cherry picked from commit d8994b0a77)
2025-06-16 17:30:52 +00:00
Miss Islington (bot)
404e8aa9f3
[3.13] gh-132969: Fix error/hang when shutdown(wait=False) and task exited abnormally (GH-133222) (GH-135343)
gh-132969:  Fix error/hang when shutdown(wait=False) and task exited abnormally (GH-133222)

When shutdown is called with wait=False, the executor thread keeps running
even after the ProcessPoolExecutor's state is reset. The executor then tries
to replenish the worker processes pool resulting in an error and a potential hang
when it comes across a worker that has died. Fixed the issue by having
_adjust_process_count() return without doing anything if the ProcessPoolExecutor's
state has been reset.

Added unit tests to validate two scenarios:
max_workers < num_tasks (exception)
max_workers > num_tasks (exception + hang)
(cherry picked from commit 598aa7cc98)

Co-authored-by: Ajay Kamdar <140011370+ogbiggles@users.noreply.github.com>
2025-06-16 14:08:03 +02:00
Miss Islington (bot)
3bd2818664
[3.13] gh-67022: Document bytes/str inconsistency in email.header.decode_header() and suggest email.headerregistry.HeaderRegistry as a sane alternative (GH-92900) (#135549)
gh-67022: Document bytes/str inconsistency in email.header.decode_header() and suggest email.headerregistry.HeaderRegistry as a sane alternative (GH-92900)

* gh-67022: Document bytes/str inconsistency in email.header.decode_header()

This function's possible return types have been surprising and error-prone
for the entirety of its Python 3.x history. It can return either:

1. `typing.List[typing.Tuple[bytes, typing.Optional[str]]]` of length >1
2. or `typing.List[typing.Tuple[str, None]]`, of length exactly 1

This means that any user of this function must be prepared to accept either
`bytes` or `str` for the first member of the 2-tuples it returns, which is a
very surprising behavior in Python 3.x, particularly given that the second
member of the tuple is supposed to represent the charset/encoding of the
first member.

This patch documents the behavior of this function, and adds test cases
to demonstrate it.

As discussed in bpo-22833, this cannot be changed in a backwards-compatible
way, and some users of this function depend precisely on the existing
behavior.

Add warnings about obsolescence of 'email.header.decode_header' and 'email.header.make_header' functions.

Recommend use of `email.headerregistry.HeaderRegistry` instead, as suggested
in https://github.com/python/cpython/pull/92900#discussion_r1112472177
(cherry picked from commit 60181f4ed0)

Co-authored-by: Dan Lenski <dlenski@gmail.com>
2025-06-15 16:02:43 -04:00
GiGaGon
a43cf1074a
[3.13] gh-135496: Fix f string exclamation mark error typo (GH-135495) (#135501) 2025-06-14 11:00:14 +03:00
Mikhail Efimov
e753a7c5f0
[3.13] gh-125723: Fix crash with f_locals when generator frame outlive their generator (GH-135453)
Backport of 8e20e42cc6 from GH-126956

Closes GH-125723
2025-06-14 04:08:03 +10:00
Tan Long
22cf289539
[3.13] gh-133439: Fix dot commands with trailing spaces are mistaken for multi-line sqlite statements in the sqlite3 command-line interface (GH-133440) (GH-133765)
(cherry picked from commit ebd4881db2)
2025-06-13 20:40:24 +03:00
Miss Islington (bot)
4455cbabf9
[3.13] gh-135462: Fix quadratic complexity in processing special input in HTMLParser (GH-135464) (GH-135482)
End-of-file errors are now handled according to the HTML5 specs --
comments and declarations are automatically closed, tags are ignored.
(cherry picked from commit 6eb6c5dbfb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-13 17:20:30 +00:00
T. Wouters
6ae51582a1
[3.13] GH-135171: Roll back all fixes for GH-127682 as they are not suitable for 3.13 (#135390) 2025-06-11 16:57:35 +02:00
Miss Islington (bot)
5f5b173cc7
[3.13] gh-132415: Update vendored setuptools in `Lib/test/wheeldata` (GH-132887) (#135391)
(cherry picked from commit c9f3f5b4ed)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-06-11 14:55:14 +00:00