Commit graph

53652 commits

Author SHA1 Message Date
Miss Islington (bot)
34d3495f32
[3.13] gh-71339: Use new assertion methods in the email tests (GH-129055) (GH-132501)
(cherry picked from commit 522766aa23)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-22 09:40:04 +00:00
Miss Islington (bot)
044fe0b2e1
[3.13] gh-131357: Add some extra tests for empty bytes and bytearray (GH-134458) (#134490)
gh-131357: Add some extra tests for empty bytes and bytearray (GH-134458)
(cherry picked from commit 7309eb60c0)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
2025-05-22 07:28:44 +00:00
Miss Islington (bot)
e0822d8d1c
[3.13] gh-134062: Fix hash collisions in IPv4Network and IPv6Network (GH-134063) (#134477)
gh-134062: Fix hash collisions in IPv4Network and IPv6Network (GH-134063)
(cherry picked from commit f3fc0c16e0)


gh-134062: Fix hash collisions in IPv4Network and IPv6Network
gh-134062: Add hash collision regression test

Co-authored-by: Mike Salvatore <mike.s.salvatore@gmail.com>
2025-05-22 03:12:28 +00:00
Miss Islington (bot)
2d11f3e154
[3.13] gh-62184: Remove _pyio import of _io.FileIO (gh-134192) (gh-134436)
This was added in the add of `_io`, isn't used since bpo-21859 when a
`_pyio` implementation was added which defines `FileIO` lower down in
the file.
(cherry picked from commit 0a68068bd2)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-05-21 17:55:55 +02:00
Miss Islington (bot)
e1e8533a5d
[3.13] gh-133982: Run unclosed file test on all io implementations (gh-134165) (gh-134434)
Update `test_io` `_check_warn_on_dealloc` to use `self.` to dispatch to
different I/O implementations.

Update the `_pyio` implementation to match expected behavior, using the
same `_dealloc_warn` design as the C implementation uses to report the
topmost `__del__` object.

The FileIO one now matches all the others, so can use IOBase. There was
a missing check on closing (self._fd must be valid), add that check
(cherry picked from commit 5b0e827521)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-05-21 17:28:29 +02:00
Miss Islington (bot)
046125e5b6
[3.13] gh-71253: Match _io exception in _pyio (gh-133985) (gh-134431)
Test was only testing _io, expanded to cover _pyio.

(cherry picked from commit 06eaf4055c)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-05-21 17:14:00 +02:00
Miss Islington (bot)
de6d199c1d
[3.13] gh-133982: Update test_bufio to use self.open (gh-133983) (gh-134429)
(cherry picked from commit 84d5f8d799)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-05-21 17:13:24 +02:00
Miss Islington (bot)
f5de0632d0
[3.13] gh-132542: Only run test_native_id_after_fork if native_id is supported (GH-134408) (GH-134414)
(cherry picked from commit e6dde10a69)

Co-authored-by: Noam Cohen <noam@noam.me>
2025-05-21 11:34:49 +00:00
Miss Islington (bot)
7ada439712
[3.13] gh-134360 Add processName attribute to logging.Formatter docstring (GH-134371) (GH-134404)
Co-authored-by: Sofia Toro <sofie.torch@outlook.com>
2025-05-21 06:16:36 +01:00
Łukasz Langa
b41e7b1e02
[3.13] gh-128066: Properly handle history file writes for RO fs on PyREPL (gh-134380) (gh-134386)
(cherry picked from commit c91ad5da9d)

Co-authored-by: Chris Patti <feoh@feoh.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-20 22:15:43 +02:00
Miss Islington (bot)
4c22fa6570
[3.13] gh-131357: Add tests for zero-sized bytes objects in test_bytes.py (GH-134234) (#134379)
gh-131357: Add tests for zero-sized bytes objects in test_bytes.py (GH-134234)
(cherry picked from commit 306f9e04e5)

Co-authored-by: abstractedfox <coldcaption@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-20 18:56:32 +00:00
Noam Cohen
aebbbaffe8
[3.13] gh-132542: Set native thread ID after fork (GH-132701) (GH-134361)
(cherry picked from commit 6b73502313)
2025-05-20 17:03:19 +00:00
Serhiy Storchaka
6279eb8c07
[3.13] gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler (GH-129648) (GH-133944)
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-20 14:46:57 +02:00
Miss Islington (bot)
edf2de0178
[3.13] Clean up test_posixpath (GH-134315) (GH-134317)
* Ensure that created files and dirs are always removed after test.
  Now addCleanup() does not conflict with tearDown().
* Use os_helper.unlink() and os_helper.rmdir().
* Import TESTFN from os_helper.
(cherry picked from commit e29171bf8a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-20 08:15:29 +00:00
Miss Islington (bot)
783675e73f
[3.13] gh-133940: test_strftime incorrectly calculates expected week (GH-134281) (#134302)
gh-133940: test_strftime incorrectly calculates expected week (GH-134281)

Let the system determine the correct tm_wday and tm_isdst.
(cherry picked from commit e3dda8f818)

Co-authored-by: Gustaf <79180496+GGyll@users.noreply.github.com>
2025-05-20 01:17:22 +00:00
Miss Islington (bot)
da506b2560
[3.13] gh-117596: Add more tests for os.path with invalid paths (GH-134189) (GH-134266)
(cherry picked from commit 871d269875)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-19 18:41:37 +00:00
Miss Islington (bot)
c1e47702a2
[3.13] gh-125225: Fix column misalignment in help('topics') output (gh-125226) (#134226)
The 'help("topics")' output was misaligned due to "ASSIGNMENTEXPRESSIONS"
exceeding the implicit maximum default column width of 19 characters.

Reduced the number of columns from 4 to 3 in the listtopics()
function to allow more space for longer topic names.
(cherry picked from commit b22460c44d)

Co-authored-by: Étienne Pelletier <EtiennePelletier@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-19 17:34:31 +02:00
Miss Islington (bot)
08c9ba5b72
[3.13] gh-134097: Print number of refs & blocks after each statement in new REPL (gh-134136) (gh-134221)
(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:25 +02:00
Serhiy Storchaka
06a8c0613e
[3.13] gh-133890: Handle UnicodeEncodeError in tarfile (GH-134147) (GH-134196)
UnicodeEncodeError is now handled the same way as OSError during
TarFile member extraction.
(cherry picked from commit 9983c7d441)
2025-05-19 10:37:36 +00:00
Miss Islington (bot)
ea9c9623f0
[3.13] gh-76023: Make os.path.realpath to ignore WinError 1005 in non-strict mode (GH-128328) (GH-134204)
(cherry picked from commit d55e11b804)

Co-authored-by: BecoKo <koev_v@yahoo.com>
2025-05-19 09:57:19 +00:00
Miss Islington (bot)
821a87e7a6
[3.13] gh-133889: Only show the path of the URL in the SimpleHTTPRequestHandler page (GH-134135) (GH-134191)
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:56 +03:00
Miss Islington (bot)
523024499e
[3.13] gh-134100: Fix use-after-free in PyImport_ImportModuleLevelObject (GH-134117) (#134172)
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:28 +05:30
Thomas Grainger
fd6a602d04
[3.13] gh-133745: Fix asyncio task factory name/context kwarg breaks (#133948)
In 3.13.3 we accidentally broke the interface for custom task factory. Factory authors added workarounds.
This PR (for 3.13.4) unbreaks task factories that haven't made a workaround yet while also supporting those that have.

NOTE: The custom task factory API will change to what we accidentally released in 3.13.3.

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
2025-05-18 06:50:07 -07:00
Miss Islington (bot)
bc0dc9d4ef
[3.13] gh-134098: Fix handling %-encoded trailing slash in SimpleHTTPRequestHandler (GH-134099) (GH-134124)
(cherry picked from commit 2f1ecb3bc4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-17 07:33:42 +00:00
Miss Islington (bot)
6dae082584
[3.13] gh-133889: Improve tests for SimpleHTTPRequestHandler (GH-134102) (GH-134122)
(cherry picked from commit fcaf009907)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-17 07:23:27 +00:00
Miss Islington (bot)
510e28ec29
[3.13] gh-134109: Fix showing comments in pydoc output for argparse (GH-134110) (GH-134113)
Comments immediately preceding the object's source code are used
if the object has no docstring.
Comments that do not describe the object should be separated from
the following source code by an empty line.
(cherry picked from commit 71cf4dd622)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-16 20:52:42 +00:00
Miss Islington (bot)
f81f1bb2f9
[3.13] Test also error messages in test_limit_int. (GH-134018) (GH-134032)
(cherry picked from commit e123a1d09b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-15 07:45:00 +00:00
Miss Islington (bot)
f474264b1e
[3.13] Improve tests for str to Fraction conversion (GH-134010) (GH-134017)
(cherry picked from commit 17d0fec702)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-14 17:42:23 +00:00
Sam Gross
e1cc789531
gh-132869: Fix crash in _PyObject_TryGetInstanceAttribute (#133700)
This fixes a crash in `_PyObject_TryGetInstanceAttribute` due to the use
of `_PyDictKeys_StringLookup` on an unlocked dictionary that may be
concurrently modified.

The underlying bug was already fixed in 3.14 and the main branch.

(partially cherry picked from commit 1b15c89a17)
2025-05-14 12:47:34 +09:00
Brandt Bucher
50b45c4f45
[3.13] GH-133543: Maintain tracking for materialized instance dictionaries (GH-133617) 2025-05-12 13:00:01 -07:00
Serhiy Storchaka
d9d8e9a00c
[3.13] gh-133677: Fix tests when running in non-UTF-8 locale (GH-133865) (GH-133939)
(cherry picked from commit 14305a83d3)
2025-05-12 17:02:19 +00:00
Victor Stinner
5ce47b96b0
[3.13] gh-133744: Fix multiprocessing interrupt test: add an event (#133746) (#133917)
gh-133744: Fix multiprocessing interrupt test: add an event (#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)
2025-05-12 14:16:52 +00:00
Miss Islington (bot)
8e923f3659
[3.13] gh-91555: disable logger while handling log record (GH-131812) (GH-133898)
Co-authored-by: Duane Griffin <duaneg@dghda.com>
2025-05-12 07:29:06 +01:00
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
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)
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)
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)
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)
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
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
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)
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
Stan Ulbrych
1dfe5def08
[3.13] gh-132017: Handle SIGCONT in pyrepl (#132918) (#133470) 2025-05-05 23:13:08 +02:00