Commit graph

30132 commits

Author SHA1 Message Date
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
AN Long
74503acba7
[3.13] gh-136759: rename lock.h to pylock.h (GH-137041) (#137075)
Rename `lock.h` to `pylock.h` to avoid conflicts with headers of other projects.
(cherry picked from commit ec02db5caa)
2025-07-24 21:36:25 +05:30
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)
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
Kumar Aditya
823bf76d37
[3.13] gh-109700: fix memory error handling in PyDict_SetDefault (#136338) (#136642)
gh-109700: fix memory error handling in `PyDict_SetDefault` (#136338)

(cherry picked from commit d22e073d2b)
2025-07-14 08:25:31 +00: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
Pablo Galindo Salgado
cba2974a54
[3.13] gh-136541: Fix several problems of perf trampolines in x86_64 and aarch64 (GH-136500) (#136545)
This commit fixes the following problems:

* The x86_64 trampolines are not preserving frame pointers
* The hardcoded offsets to the code segment from the FDE only worked properly for x64_64
* The CIE data was not following conventions of aarch64
* The eh_frame for aarch64 was not fully correct
(cherry picked from commit 236f733d8f)
2025-07-11 14:02:19 +00:00
Miss Islington (bot)
aa3c6421ef
[3.13] gh-52876: Implement missing parameter in codecs.StreamReaderWriter functions (GH-136498) (#136515)
gh-52876: Implement missing parameter in `codecs.StreamReaderWriter` functions (GH-136498)

Closes GH-52876
(cherry picked from commit 35e2c35970)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-07-10 18:06:34 +02:00
Miss Islington (bot)
f17be28cd8
[3.13] gh-136155: Docs: only add custom OpenGraph protocol meta tags for HTML builds (GH-136187) (#136383)
Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2025-07-08 10:04:09 +03: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)
fc77192109
[3.13] gh-135069: Fix exception message in encodings.idna module (GH-135071) (#136236)
gh-135069: Fix exception message in encodings.idna module (GH-135071)
(cherry picked from commit 8dc3383abe)

Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
2025-07-03 10:31:43 +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
Victor Stinner
e3a277c8d8
[3.13] gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614) (#136126)
gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614)

(cherry picked from commit b1056c2a44)

Co-authored-by: Xuanteng Huang <44627253+xuantengh@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-07-01 11:26:52 +02:00
Miss Islington (bot)
e194793602
[3.13] gh-85702: Catch PermissionError in zoneinfo.load_tzdata() (GH-136117) (#136136)
gh-85702: Catch PermissionError in zoneinfo.load_tzdata() (GH-136117)
(cherry picked from commit ee47670e8b)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-06-30 16:31:45 +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
Miss Islington (bot)
76dd0eee05
[3.13] Doc: Fix duplicate words in idlelib (GH-136089) (#136091)
Doc: Fix duplicate words in idlelib (GH-136089)
(cherry picked from commit f04d2b8819)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-06-29 07:09:36 +00: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)
d105eae96e
[3.13] gh-135968: Add iOS binary stubs for strip (GH-135970) (#136015)
Adds iOS binary stubs for invoking `strip`
(cherry picked from commit 0c6c09b737)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-06-27 13:38:27 +08:00
Russell Keith-Magee
07a763624d
[3.13] gh-135966: Modify iOS testbed to make app_packages a site directory (GH-135967) (#136013)
The iOS testbed now treats the app_packages folder as a site folder. This ensures it is
on the path, but also ensures any .pth files are processed on app startup.
(cherry picked from commit b38810bab7)
2025-06-27 13:37:05 +08:00
Miss Islington (bot)
784c0eda7e
[3.13] gh-135995: Fix missing char in palmos encoding (GH-135990) (#136002)
gh-135995: Fix missing char in palmos encoding (GH-135990)

0x8b correctly encodes to ‹, but 0x9b was mistakenly marked as a control character instead of ›.
---------
(cherry picked from commit 58a42dea97)

Co-authored-by: Nathan Korth <nkorth@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-06-26 22:59:24 +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
Sam Gross
c64df2a3ec
[3.13] gh-135871: Fix needless spinning in _PyMutex_LockTimed with zero timeout (gh-135872) (gh-135947)
The free threading build could spin unnecessarily on `_Py_yield()` if the initial
compare and swap failed.
(cherry picked from commit cbfaf41caf)

Co-authored-by: Joseph Tibbertsma <josephtibbertsma@gmail.com>
2025-06-25 17:09:17 +00: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)
469f69d4e2
[3.13] gh-135878: Fix crash in types.SimpleNamespace.__repr__ (GH-135889) (#135895)
gh-135878: Fix crash in `types.SimpleNamespace.__repr__` (GH-135889)
(cherry picked from commit b3ab94acd3)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-06-24 16:59:29 +00: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
Miss Islington (bot)
b79e64b67d
[3.13] patchcheck: use URL paths to identify upstream remote (GH-135806) (#135809)
Co-authored-by: Kattni <kattni@kattni.com>
2025-06-23 12:57:03 +03: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)
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)
a80d47ecb1
[3.13] gh-135171: Update documentation for the generator expression (GH-135351) (GH-135525)
gh-135171: Update documentation for the generator expression (GH-135351)

* gh-135171: Update documentation for the generator expression

Document that the iterator for the leftmost "for" clause is created
immediately.

* Update Doc/reference/expressions.rst



---------
(cherry picked from commit 8979d3afe3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Brian Skinn <brian.skinn@gmail.com>
2025-06-15 00:38:52 +00:00
Miss Islington (bot)
15340775f8
[3.13] gh-135497: fix MAXLOGNAME detection in configure.ac (GH-135508) (#135517)
gh-135497: fix `MAXLOGNAME` detection in `configure.ac` (GH-135508)
(cherry picked from commit 2e15a50851)

Co-authored-by: Caleb Xu <calebcenter@live.com>
2025-06-14 16:49:13 +00: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