Commit graph

33958 commits

Author SHA1 Message Date
Miss Islington (bot)
90aa13ae47
[3.14] gh-133374: fix test_python_legacy_windows_stdio (GH-134080) (GH-134314)
(cherry picked from commit 652d6938ef)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2025-05-20 06:53:44 +00:00
Miss Islington (bot)
4effd060fc
[3.14] gh-132983: Convert zstd `__new__` methods to Argument Clinic (GH-133860) (#133915)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-20 03:25:24 +01:00
Miss Islington (bot)
7cbc3ea8fb
[3.14] gh-134235: Import Autocomplete for Builtin Modules (GH-134277) (#134285)
gh-134235: Import Autocomplete for Builtin Modules (GH-134277)

* added enhancement auto completing import with sys builtins

---------
(cherry picked from commit 8421b03b16)

Co-authored-by: Tom Wang <85062819+tommix626@users.noreply.github.com>
Co-authored-by: Hunter <hyoung3@gmail.com>
2025-05-19 21:46:50 +00:00
Steve Dower
7686c752b3
[3.14] gh-133779: Revert Windows generation of pyconfig.h and go back to a static header. (GH-133966)
Extension builders must specify Py_GIL_DISABLED if they want to link to the free-threaded builds.
This was usually the case already, but this change guarantees it in all circumstances.
2025-05-19 21:24:53 +01:00
Miss Islington (bot)
7d995ea9fd
[3.14] gh-134214: Fix test case in pyrepl (gh-134223) (gh-134229)
(cherry picked from commit faebf87b37)

Co-authored-by: Jessica Temporal <jtemporal@users.noreply.github.com>
2025-05-19 14:51:46 +00:00
Miss Islington (bot)
a3c3d6f0ef
[3.14] gh-134158: Fix PyREPL coloring of double braces in f/t-strings (gh-134159) (#134227)
Co-authored-by: Loïc Simon <loic.pano@gmail.com>
Co-authored-by: Loïc Simon <loic.simon@napta.io>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-19 17:39:05 +03:00
Miss Islington (bot)
182464eb9e
[3.14] gh-134097: Print number of refs & blocks after each statement in new REPL (gh-134136) (gh-134220)
(cherry picked from commit c31547a591)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-19 16:13:44 +02:00
Miss Islington (bot)
d9c08c57e9
[3.14] gh-133999: Fix except parsing regression in 3.14 (GH-134035) (#134206)
gh-133999: Fix `except` parsing regression in 3.14 (GH-134035)
(cherry picked from commit 84914ad0e5)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-19 14:26:27 +03:00
Miss Islington (bot)
70735878ab
[3.14] gh-133889: Only show the path of the URL in the SimpleHTTPRequestHandler page (GH-134135) (GH-134190)
The query and fragment are ambiguous and not used.
(cherry picked from commit 5cbc8c632e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-18 22:16:37 +03:00
Miss Islington (bot)
bb5f92adcf
[3.14] gh-134144: Fix use-after-free in zapthreads() (GH-134145) (#134182)
gh-134144: Fix use-after-free in zapthreads() (GH-134145)
(cherry picked from commit f2de1e6861)

Co-authored-by: b-pass <b-pass@users.noreply.github.com>
2025-05-18 15:29:19 +00:00
Miss Islington (bot)
8d51ed6b05
[3.14] gh-134100: Fix use-after-free in PyImport_ImportModuleLevelObject (GH-134117) (#134171)
gh-134100: Fix use-after-free in `PyImport_ImportModuleLevelObject` (GH-134117)
(cherry picked from commit 4e9005d32f)

Co-authored-by: Nico-Posada <102486290+Nico-Posada@users.noreply.github.com>
2025-05-18 20:38:40 +05:30
Miss Islington (bot)
eaee2ae033
[3.14] gh-134064: Fix sys.remote_exec() error checking (GH-134067) (#134162)
gh-134064: Fix sys.remote_exec() error checking (GH-134067)
(cherry picked from commit 009e7b3698)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-17 22:50:00 +00:00
Miss Islington (bot)
1ba5e65b76
[3.14] gh-134119: Fix crash from calling next() on exhausted template iterator (GH-134120) (#134153)
gh-134119: Fix crash from calling next() on exhausted template iterator (GH-134120)
(cherry picked from commit fc7f4c3666)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-17 19:48:54 +00:00
Miss Islington (bot)
d7230e1110
[3.14] gh-134098: Fix handling %-encoded trailing slash in SimpleHTTPRequestHandler (GH-134099) (GH-134123)
(cherry picked from commit 2f1ecb3bc4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-17 07:37:43 +00:00
Miss Islington (bot)
5cdad8c90c
[3.14] gh-133889: Improve tests for SimpleHTTPRequestHandler (GH-134102) (GH-134121)
(cherry picked from commit fcaf009907)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-17 07:27:38 +00:00
Miss Islington (bot)
dda5dc5f06
[3.14] gh-132388: test HACL* and OpenSSL hash functions in pure Python HMAC (GH-134051) (#134089)
gh-132388: test HACL* and OpenSSL hash functions in pure Python HMAC (GH-134051)
(cherry picked from commit 73d71a416f)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-16 12:26:37 +00:00
Miss Islington (bot)
fede4ed1d3
[3.14] Test also error messages in test_limit_int. (GH-134018) (GH-134033)
(cherry picked from commit e123a1d09b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-15 07:47:24 +00:00
Miss Islington (bot)
f2a4b1066b
[3.14] gh-133970: Make PEP750 types generic (GH-133976) (#134029)
gh-133970: Make PEP750 types generic (GH-133976)
(cherry picked from commit c3a1da5b93)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-15 06:39:39 +00:00
Miss Islington (bot)
4adb1ddac8
[3.14] Improve tests for str to Fraction conversion (GH-134010) (GH-134016)
(cherry picked from commit 17d0fec702)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-14 18:18:04 +00:00
Miss Islington (bot)
d6cb8fa86e
[3.14] gh-133701: Fix incorrect __annotations__ on TypedDict defined under PEP 563 (GH-133772) (#134003)
gh-133701: Fix incorrect `__annotations__` on TypedDict defined under PEP 563 (GH-133772)
(cherry picked from commit 9836503b48)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-14 13:54:29 +00:00
Miss Islington (bot)
66d6860439
[3.14] gh-132641: fix race in lru_cache under free-threading (GH-133787) (#133979)
gh-132641: fix race in `lru_cache` under free-threading (GH-133787)

Fix race in `lru_cache` by acquiring critical section on the cache object itself and call the lock held variant of dict functions to modify the underlying dict.
(cherry picked from commit 9ad0c7b0f1)

Co-authored-by: Peter Hawkins <phawkins@google.com>
2025-05-14 07:11:38 +00:00
Miss Islington (bot)
69b4387f78
[3.14] gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler (GH-129648) (GH-133942)
If the error handler is used, a new bytes object is created to set as
the object attribute of UnicodeDecodeError, and that bytes object then
replaces the original data. A pointer to the decoded data will became invalid
after destroying that temporary bytes object. So we need other way to return
the first invalid escape from _PyUnicode_DecodeUnicodeEscapeInternal().

_PyBytes_DecodeEscape() does not have such issue, because it does not
use the error handlers registry, but it should be changed for compatibility
with _PyUnicode_DecodeUnicodeEscapeInternal().
(cherry picked from commit 9f69a58623)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-13 16:25:08 +03:00
Miss Islington (bot)
f0a7a6c2cc
[3.14] gh-133886: Fix sys.remote_exec() for non-UTF-8 paths (GH-133887) (GH-133963)
It now supports non-ASCII paths in non-UTF-8 locales and
non-UTF-8 paths in UTF-8 locales.
(cherry picked from commit c09cec5d69)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-13 09:23:39 +00:00
Miss Islington (bot)
198dc8dcb2
[3.14] gh-133885: skip test_compress_locking in test_zstd (GH-133943) (#133949)
gh-133885: skip `test_compress_locking` in `test_zstd` (GH-133943)
(cherry picked from commit e8665d4d46)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-13 08:27:17 +00:00
Miss Islington (bot)
3467656b18
[3.14] gh-132775: Add _PyFunction_GetXIData() (gh-133955)
(cherry picked from commit 8cf4947b0f, AKA gh-133481)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-12 22:37:55 +00:00
Miss Islington (bot)
c15980b57b
[3.14] gh-133653: Fix argparse.ArgumentParser with the formatter_class argument (GH-133813) (GH-133941)
* Fix TypeError when formatter_class is a custom subclass of
  HelpFormatter.
* Fix TypeError when formatter_class is not a subclass of
  HelpFormatter and non-standard prefix_char is used.
* Fix support of colorizing when formatter_class is not a subclass of
  HelpFormatter.
* Remove the prefix_chars parameter of HelpFormatter.
(cherry picked from commit 734e15b70d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-12 17:54:07 +00:00
Miss Islington (bot)
c11fc4bc96
[3.14] gh-133677: Fix tests when running in non-UTF-8 locale (GH-133865) (GH-133938)
(cherry picked from commit 14305a83d3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-12 16:41:40 +00:00
Miss Islington (bot)
89c801b84e
[3.14] gh-133925: Make typing._UnionGenericAlias hashable (GH-133929) (#133936)
gh-133925: Make typing._UnionGenericAlias hashable (GH-133929)
(cherry picked from commit 8d478c7953)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-12 15:50:10 +00:00
Miss Islington (bot)
cedc37a894
[3.14] gh-91555: disable logger while handling log record (GH-131812) (GH-133899)
Prevent the possibility of re-entrancy leading to deadlock or infinite recursion (caused by logging triggered by logging), by disabling logging while the logger is handling log messages.
(cherry picked from commit 2561e148ec)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
2025-05-12 13:02:21 +01:00
Miss Islington (bot)
f5d2d73995
[3.14] gh-133744: Fix multiprocessing interrupt test: add an event (GH-133746) (#133916)
gh-133744: Fix multiprocessing interrupt test: add an event (GH-133746)

Add an event to synchronize the parent process with the child
process: wait until the child process starts sleeping.
(cherry picked from commit c2989b7070)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-12 09:38:07 +00:00
Miss Islington (bot)
5c9f0ae49d
gh-133703: dict: fix calculate_log2_keysize() (GH-133809)
(cherry picked from commit 92337f666e)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2025-05-11 16:34:15 +09:00
Miss Islington (bot)
39485d5935
[3.14] Add classmethod to setUpClass in test_pdb (GH-133840) (#133846)
Add classmethod to setUpClass in test_pdb (GH-133840)
(cherry picked from commit 4f2f780d53)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2025-05-10 18:38:14 +00:00
Miss Islington (bot)
e7e105f51b
[3.14] gh-86155: Fix data loss after unclosed script or style tag in HTMLParser (GH-22658) (GH-133844)
When calling .close() the HTMLParser should flush all remaining content,
even when that content is in an unclosed script or style tag.
(cherry picked from commit 53383e90e4)

Co-authored-by: Waylan Limberg <waylan.limberg@icloud.com>
2025-05-10 18:02:23 +00:00
Miss Islington (bot)
856e5903ba
[3.14] gh-133783: Fix __replace__ on AST nodes for optional attributes (GH-133797) (#133842)
gh-133783: Fix __replace__ on AST nodes for optional attributes (GH-133797)
(cherry picked from commit 7dddb4e667)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-10 16:44:07 +00:00
Miss Islington (bot)
13c94d0401
[3.14] gh-132642: document how to render human-readable timedelta objects (GH-133825) (#133837)
gh-132642: document how to render human-readable `timedelta` objects (GH-133825)
(cherry picked from commit efcc42ba70)

Co-authored-by: Kentaro Jay Takahashi <64148935+KentaroJay@users.noreply.github.com>
2025-05-10 16:00:36 +00:00
Miss Islington (bot)
381159b2be
[3.14] gh-77057: Fix handling of invalid markup declarations in HTMLParser (GH-9295) (GH-133833)
(cherry picked from commit 76c0b01bc4)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-10 14:58:23 +00:00
Miss Islington (bot)
62109c4174
[3.14] gh-133009: fix UAF in xml.etree.ElementTree.Element.__deepcopy__ (GH-133010) (#133805)
gh-133009: fix UAF in `xml.etree.ElementTree.Element.__deepcopy__` (GH-133010)
(cherry picked from commit 116a9f9b37)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-10 07:58:10 +00:00
Miss Islington (bot)
99ca086f91
[3.14] gh-132983: Don't allow trailer data in ZstdFile (GH-133736) (#133799)
gh-132983: Don't allow trailer data in ZstdFile (GH-133736)
(cherry picked from commit 50b5370664)

Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
2025-05-10 02:58:43 +00:00
Miss Islington (bot)
d9571c938c
[3.14] GH-132983: PEP 7 and Argument Clinic changes for zstd (GH-133791) (#133792)
GH-132983: PEP 7 and Argument Clinic changes for zstd (GH-133791)
(cherry picked from commit 1978904a2f)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-10 00:59:30 +00:00
Miss Islington (bot)
aaeca91b05
[3.14] gh-133532: Run GC fast cycles test in subprocess. (gh-133533) (gh-133716)
This makes the test more reliable since there are not extra objects on the heap leftover
from other tests.

(cherry picked from commit 8598e57942)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
2025-05-09 12:30:27 -07:00
Miss Islington (bot)
359696f031
[3.14] gh-133519: Add console to resources in libregrtest (GH-133520) (#133776)
gh-133519: Add console to resources in libregrtest (GH-133520)

Add console to resources in libregrtest
(cherry picked from commit 4274b47156)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2025-05-09 16:56:39 +00:00
Miss Islington (bot)
5e730a8baa
[3.14] gh-133741: Fix _can_strace(): check --trace option (GH-133766) (#133774)
gh-133741: Fix _can_strace(): check --trace option (GH-133766)

The --trace option needs strace 5.5 or newer.
(cherry picked from commit 67086282fc)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-09 16:52:23 +00:00
Miss Islington (bot)
2df021d9dc
[3.14] gh-132983: Clean-ups for `_zstd` (GH-133670) (#133756)
gh-132983: Clean-ups for ``_zstd`` (GH-133670)
(cherry picked from commit c2a5d4b383)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-09 15:58:58 +01:00
Miss Islington (bot)
52d89f5343
[3.14] gh-133682: Fix inconsistent set ordering in annotationlib test (GH-133702) (#133754)
gh-133682: Fix inconsistent set ordering in annotationlib test (GH-133702)
(cherry picked from commit a2a0fa91c4)

Co-authored-by: Akshat Gupta <akshat.gupta24@gmail.com>
2025-05-09 14:27:13 +00:00
Miss Islington (bot)
beb8a50ca1
[3.14] gh-133439: Fix dot commands with trailing spaces are mistaken for multi-line sqlite statements in the sqlite3 command-line interface (GH-133440) (GH-133738)
(cherry picked from commit ebd4881db2)

Co-authored-by: Tan Long <tanloong@foxmail.com>
2025-05-09 15:17:24 +03:00
Miss Islington (bot)
3937c78e36
[3.14] gh-69426: HTMLParser: only unescape properly terminated character entities in attribute values (GH-95215) (GH-133704)
According to the HTML5 spec, named character references in attribute values
should only be processed if they are not followed by an ASCII alphanumeric,
or an equals sign.
(cherry picked from commit 77b14a6d58)


https: //html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state

Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@googlemail.com>
2025-05-09 09:43:21 +03:00
Miss Islington (bot)
0c340d1083
[3.14] gh-133541: Handle SyntaxError raised by the tokenizer on user input (GH-133606) (#133709) 2025-05-08 20:41:01 +00:00
Miss Islington (bot)
3e7552e4ae
[3.14] gh-132762: Fix underallocation bug in dict.fromkeys()(gh-133627) (gh-133685)
The function `dict_set_fromkeys()` adds elements of a set to an existing
dictionary. The size of the expanded dictionary was estimated with
`PySet_GET_SIZE(iterable)`, which did not take into account the size of the
existing dictionary.
(cherry picked from commit 421ba589d0)

Co-authored-by: Angela Liss <59097311+angela-tarantula@users.noreply.github.com>
2025-05-08 17:39:39 +00:00
Miss Islington (bot)
1059548686
[3.14] gh-132775: Add _PyCode_GetScriptXIData() (gh-133676)
This converts functions, code, str, bytes, bytearray, and memoryview objects to PyCodeObject,
and ensure that the object looks like a script.  That means no args, no return, and no closure.
_PyCode_GetPureScriptXIData() takes it a step further and ensures there are no globals.

We also add _PyObject_SupportedAsScript() to the internal C-API.

(cherry picked from commit c81fa2b9cd, AKA gh-133480)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-08 10:05:34 -06:00
Miss Islington (bot)
dc1a4dda88
[3.14] gh-131031: Fix test_pickle when invoked directly (GH-133356) (GH-133673)
(cherry picked from commit e15bbfafbc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-08 15:19:58 +00:00