Commit graph

124311 commits

Author SHA1 Message Date
Victor Stinner
5cd56b249f
[3.13] gh-133441: Fix STORE_ATTR_WITH_HINT bytecode (#133446)
Deoptimize if the dict is a dict subclass.

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-05-11 23:10:04 +02:00
Miss Islington (bot)
927da99219
[3.13] gh-133823: update "Pending Removal in 3.15" notes about TypedDict (GH-133864) (#133871)
gh-133823: update "Pending Removal in 3.15" notes about `TypedDict` (GH-133864)
(cherry picked from commit f91127ae1a)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-11 08:18:04 +00:00
Inada Naoki
f0a88e2ce5
gh-133703: dict: fix calculate_log2_keysize() (GH-133809)
(cherry picked from commit 92337f666e)
2025-05-11 15:14:11 +09:00
Miss Islington (bot)
26b6ab49e4
[3.13] Add classmethod to setUpClass in test_pdb (GH-133840) (#133847)
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:34:32 +00:00
Miss Islington (bot)
e76ff560b0
[3.13] gh-86155: Fix data loss after unclosed script or style tag in HTMLParser (GH-22658) (GH-133845)
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 17:58:29 +00:00
Miss Islington (bot)
18501a11e0
[3.13] gh-132642: document how to render human-readable timedelta objects (GH-133825) (#133836)
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 15:57:29 +00:00
Miss Islington (bot)
5afb224564
[3.13] gh-117088: Fix AIX build (GH-132595) (GH-133839)
(cherry picked from commit 47f1722d80)

Co-authored-by: Ayappan Perumal <ayappap2@in.ibm.com>
2025-05-10 15:54:05 +00:00
Miss Islington (bot)
aa0c3d1098
[3.13] gh-77057: Fix handling of invalid markup declarations in HTMLParser (GH-9295) (GH-133834)
(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:55:12 +00:00
Miss Islington (bot)
3de6546381
[3.13] gh-132971: Update shutil.which() docs (GH-133067) (#133804)
gh-132971: Update shutil.which() docs (GH-133067)
(cherry picked from commit d13d5fdf61)

Co-authored-by: Kokona <125976684+985025074@users.noreply.github.com>
2025-05-10 10:51:38 +02:00
Miss Islington (bot)
9718880ba9
[3.13] gh-133009: fix UAF in xml.etree.ElementTree.Element.__deepcopy__ (GH-133010) (#133806)
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:55:47 +00:00
Miss Islington (bot)
57efb77fef
[3.13] Update HTTP links in the _pydatetime docstrings (GH-133025) (GH-133782)
(cherry picked from commit aed28eb5a0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-09 19:02:41 +00:00
Miss Islington (bot)
ddd6ca193f
[3.13] gh-133519: Add console to resources in libregrtest (GH-133520) (#133777)
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:53:19 +00:00
Miss Islington (bot)
0a39a182cf
[3.13] Docs: use boolean constants for returning boolean value (GH-133325) (GH-133761)
(cherry picked from commit 076004ae54)

Co-authored-by: Yongzi Li <1538321957@qq.com>
2025-05-09 14:19:23 +00:00
Miss Islington (bot)
b812cdd266
[3.13] Manpage: -X gil is not related to PYTHON_HISTORY (GH-133753) (#133759)
Co-authored-by: Stefano Rivera <stefano@rivera.za.net>
2025-05-09 14:18:56 +00:00
Miss Islington (bot)
a98d46a9aa
[3.13] gh-133644: update Py_InteractiveFlag deprecation notice (GH-133749) (#133752)
gh-133644: update `Py_InteractiveFlag` deprecation notice (GH-133749)
(cherry picked from commit 3ed8d6fdd1)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-09 13:48:58 +00:00
Miss Islington (bot)
d14a1b7a0d
[3.13] gh-130197: Test pygettext --output option (GH-133041) (GH-133266)
(cherry picked from commit e5e51bd7f7)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-09 07:56:58 +00:00
Miss Islington (bot)
4c7a04b8bd
[3.13] gh-133412: amend docs for the inst definition (GH-133708) (#133730)
gh-133412: amend docs for the `inst` definition (GH-133708)

The `stack_effect` is incorrectly documented as being allowed to be optional.
(cherry picked from commit f77dac66e1)

Co-authored-by: Nybblista <170842536+nybblista@users.noreply.github.com>
2025-05-09 07:12:44 +00:00
Miss Islington (bot)
3e55441090
[3.13] gh-69426: HTMLParser: only unescape properly terminated character entities in attribute values (GH-95215) (GH-133586)
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:54 +03:00
Steve Dower
df858161d5
gh-133626: Ensure the traditional Windows installer doesn't accidentally pick up site-packages (GH-133693) 2025-05-08 20:16:15 +00:00
Miss Islington (bot)
c2cddb7466
[3.13] gh-133403: Check Tools/build/verify_ensurepip_wheels.py with mypy (GH-133453) (#133690)
gh-133403: Check `Tools/build/verify_ensurepip_wheels.py` with mypy (GH-133453)
(cherry picked from commit 5f3d3f2a6c)

Co-authored-by: Flosckow <66554425+Flosckow@users.noreply.github.com>
Co-authored-by: Daniil Dumchenko <dumchenko.de@sibvaleo.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-08 18:17:43 +00:00
Sam Gross
6ab4a4a32c
[3.13] gh-132762: Fix underallocation bug in dict.fromkeys()(gh-133627) (gh-133686)
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:40:05 +00:00
Serhiy Storchaka
8e334f40b8
[3.13] gh-131031: Fix test_pickle when invoked directly (GH-133356) (GH-133675)
(cherry picked from commit e15bbfafbc)
2025-05-08 15:23:54 +00:00
Miss Islington (bot)
fabe89b078
[3.13] gh-133454: Mark tests with many threads that use much memory as bigmem (GH-133456) (GH-133664)
(cherry picked from commit 26839eae20)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-08 13:20:34 +00:00
Miss Islington (bot)
e0aefbd263
gh-133597: Fix memory leak if error occurred in _sys_getwindowsversion_from_kernel32 (GH-133598)
(cherry picked from commit 0ec8fc83a8)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
2025-05-08 11:32:59 +00:00
TERESH1
a719e5fbb6
[3.13] gh-133516: Raise ValueError when constants True, False or None are used as an identifier after NFKC normalization (GH-133523) (#133615) 2025-05-08 12:18:26 +01:00
Miss Islington (bot)
eefe7e22b8
[3.13] Doc: Allow translating a code block in the tutorial (GH-131353) (#133649)
Doc: Allow translating a code block in the tutorial (GH-131353)
(cherry picked from commit 3224b99872)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-08 09:29:34 +00:00
Miss Islington (bot)
a0dd4f0c56
[3.13] gh-133639: Fix test_auto_indent_default() doesn't run input_code (GH-133640) (#133647) 2025-05-08 08:47:38 +00:00
sobolevn
aed613fe2f
[3.13] gh-133403: Type Tools/build/update_file.py and check it with mypy (GH-133404) (#133637)
(cherry picked from commit 50b52cba2d)
2025-05-08 06:59:04 +00:00
Miss Islington (bot)
a063d6c794
[3.13] gh-127833: lexical analysis: Add backticks to BOM example (GH-132407) (#133633)
gh-127833: lexical analysis: Add backticks to BOM example (GH-132407)
(cherry picked from commit 0552ce0fb2)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-08 01:42:05 +00:00
Miss Islington (bot)
6beec6c813
[3.13] gh-133361: move the explanation of dict equal before its use (GH-133424) (#133621)
gh-133361: move the explanation of dict equal before its use (GH-133424)

Also move up the explanation of insertion order preservation.  Both paragraphs seemed out of place down where they were.
---------
(cherry picked from commit 61ac88c06e)

Co-authored-by: Yongzi Li <1538321957@qq.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-05-07 22:11:03 +00:00
Miss Islington (bot)
ce9d708e8c
[3.13] gh-131535: Fix stale example in html.parser docs, make examples doctests (GH-131551) (GH-133587)
(cherry picked from commit ee76e36d76)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2025-05-07 20:33:23 +03:00
Steve Dower
ac99d7e5cc
gh-133512: Adds warnings to py.exe launcher about subcommands belonging to Python install manager (GH-133514) 2025-05-07 13:24:33 +01:00
Brandt Bucher
3f93295bbe
[3.13] GH-133231: Backport PYTHON_JIT documentation to 3.13 (GH-133539) 2025-05-06 21:31:54 +00:00
Victor Stinner
d4f6367b8e
[3.13] gh-132921: Fix setuptools._distutils.dep_util deprecation (#133522)
gh-132921: Fix setuptools._distutils.dep_util deprecation

Get newer_group from setuptools.modified on recent setuptools
versions, but keep support for old setuptools versions.
2025-05-06 20:40:36 +02:00
Miss Islington (bot)
fe18437089
[3.13] gh-130117: Document why nested Union, Literal, and Annotated types referenced through a type alias are not flattened (GH-130119) (#133488)
gh-130117: Document why nested `Union`, `Literal`, and `Annotated` types referenced through a type alias are not flattened (GH-130119)

(cherry picked from commit b936ccdb6f)

Co-authored-by: Valentin Berlier <berlier.v@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-06 02:13:22 +00:00
Stan Ulbrych
1dfe5def08
[3.13] gh-132017: Handle SIGCONT in pyrepl (#132918) (#133470) 2025-05-05 23:13:08 +02:00
Łukasz Langa
891232f338
[3.13] gh-131878: Fix input of unicode characters with two or more code points in new pyrepl on Windows (gh-131901) (gh-133468)
(cherry picked from commit 0c5151bc81)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-05-05 23:08:09 +02:00
Łukasz Langa
76f52c434c
[3.13] gh-130804: Fix support of typing unicode chars in pyrepl (GH-130805) (GH-133462)
(cherry picked from commit 7c98b0674d)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
2025-05-05 21:39:21 +02:00
Łukasz Langa
e4d68488bc
[3.13] GH-132439: Fix REPL swallowing characters entered with AltGr on cmd.exe (GH-132440) (GH-133460)
(cherry picked from commit 07f416a3f0)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-05 20:09:34 +02:00
Miss Islington (bot)
a2bf7a0a47
[3.13] gh-124096: Enable REPL virtual terminal support on Windows (GH-124119) (GH-133457)
To support virtual terminal mode in Windows PYREPL, we need a scanner
to read over the supported escaped VT sequences.

Windows REPL input was using virtual key mode, which does not support
terminal escape sequences. This patch calls `SetConsoleMode` properly
when initializing and send sequences to enable bracketed-paste modes
to support verbatim copy-and-paste.
(cherry picked from commit a65366ed87)

Co-authored-by: Y5 <124019959+y5c4l3@users.noreply.github.com>
Signed-off-by: y5c4l3 <y5c4l3@proton.me>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Dustin L. Howett <dustin@howett.net>
Co-authored-by: wheeheee <104880306+wheeheee@users.noreply.github.com>
2025-05-05 19:39:06 +02:00
Miss Islington (bot)
1105ed316b
[3.13] GH-133410: Use commit hashes for change detection (gh-133416) (#133427)
GH-133410: Use commit hashes for change detection (gh-133416)
(cherry picked from commit d530e74e44)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-05 10:26:58 -07:00
Miss Islington (bot)
d84a762a64
[3.13] gh-63882: Break down and tests in test_minidom (GH-133026) (#133451)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-05 19:31:53 +03:00
Łukasz Langa
87b14c8f21
[3.13] gh-131878: Handle top level exceptions in new pyrepl and prevent of closing it (GH-131910) (GH-133445)
Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
2025-05-05 17:20:54 +02:00
Miss Islington (bot)
f371b23bab
[3.13] gh-107006: Move threading.local docstring to docs (GH-131840) (#133432)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-05-05 16:18:00 +03:00
Miss Islington (bot)
df1669ed20
[3.13] Bump mypy to 1.15 (GH-133405) (#133429)
Bump mypy to 1.15 (GH-133405)
(cherry picked from commit 8467026ed6)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-05 10:54:56 +00:00
Miss Islington (bot)
e89ca3991c
[3.13] [tests] test_subprocess maybe avoid a timeout race condition? (GH-133420) (#133421)
[tests] test_subprocess maybe avoid a timeout race condition? (GH-133420)

The few buildbot failures on https://github.com/python/cpython/pull/133103
are possibly just due to racing a child process launch and exit?
(cherry picked from commit b64aa302d7)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-05-05 04:25:41 +00:00
Miss Islington (bot)
3d1b8e2a96
[3.13] gh-133089: Use original timeout value for TimeoutExpired when the func subprocess.run is called with a timeout (GH-133103) (#133418)
gh-133089: Use original timeout value for `TimeoutExpired` when the func `subprocess.run` is called with a timeout (GH-133103)
(cherry picked from commit 2bbcaedb75)

Signed-off-by: Manjusaka <me@manjusaka.me>
Co-authored-by: Nadeshiko Manju <me@manjusaka.me>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-05-05 01:38:30 +00:00
Miss Islington (bot)
5daeebbbf2
[3.13] gh-109700: Improve stress tests for interpreter creation (GH-109946) (GH-133391)
* Ensure that destructors are called in the test that created interpreters, not after finishing it.
* Try to create/run interpreters in threads simultaneously.
* Mark tests that requires over 6GB of memory with bigmemtest.
(cherry picked from commit 61b50a98b4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-04 19:18:49 +00:00
Serhiy Storchaka
973e2d3e29
[3.13] gh-122559: Synchronize C and Python implementation of the io module about pickling (GH-122628) (GH-133381)
In the C implementation, remove __reduce__ and __reduce_ex__ methods
that always raise TypeError and restore __getstate__ methods that always
raise TypeErrori.

This restores fine details of the pre-3.12 behavior and unifies
both implementations.
(cherry picked from commit e9253ebf74)
2025-05-04 16:04:09 +00:00
Serhiy Storchaka
3c9d1778ef
[3.13] bpo-44172: Keep reference to original window in curses subwindow objects (GH-26226) (GH-133370)
The X/Open curses specification[0] and ncurses documentation[1]
both state that subwindows must be deleted before the main window.

Deleting the windows in the wrong order causes a double-free with
NetBSD's curses implementation.

To fix this, keep track of the original window object in the subwindow
object, and keep a reference to the original for the lifetime of
the subwindow.

[0] https://pubs.opengroup.org/onlinepubs/7908799/xcurses/delwin.html
[1] https://invisible-island.net/ncurses/man/curs_window.3x.html
(cherry picked from commit 0af61fe2f4)

Co-authored-by: Michael Forney <mforney@mforney.org>
2025-05-04 11:15:43 +00:00