Commit graph

30680 commits

Author SHA1 Message Date
Miss Islington (bot)
c54ee87278
[3.12] gh-123836: Check zero signs in math_testcases.txt (GH-123854) (#124162)
gh-123836: Check zero signs in math_testcases.txt (GH-123854)

Just like cmath_testcases.txt. These tests require IEEE 754 anyway.

Correct zero sign for sqrt tests to match math.h convention.
(cherry picked from commit 28aea5d07d)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-09-17 08:39:44 +00:00
Miss Islington (bot)
2f9dc65e12
[3.12] GH-124108: Skip test_locale.test_strcoll_with_diacritic() on NetBSD (GH-124110) (#124147)
GH-124108: Skip test_locale.test_strcoll_with_diacritic() on NetBSD (GH-124110)

Skip test_strcoll_with_diacritic() and test_strxfrm_with_diacritic()
of test_locale on NetBSD due to lack of UTF-8 LC_COLLATE
support.
(cherry picked from commit 10de3600a9)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2024-09-16 23:28:51 +00:00
Miss Islington (bot)
3f5d18d351
[3.12] gh-94808: Add test coverage for "starred kind" in _PyPegen_set_expr_context (GH-119222) (GH-119264)
Add test coverage for "starred kind" in _PyPegen_set_expr_context
(cherry picked from commit 8231a24454)

Co-authored-by: Mark Jason Dominus (陶敏修) <mjd@pobox.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-09-16 10:43:31 +02:00
Miss Islington (bot)
ffde4cddc9
[3.12] gh-98442: fix locations of with statement's cleanup instructions (GH-120763) (#120787)
gh-98442: fix locations of with statement's cleanup instructions (GH-120763)
(cherry picked from commit 55596ae044)


gh-98442: fix location of with statement's cleanup instructions

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-09-15 19:14:19 +00:00
Miss Islington (bot)
84e3f6078b
[3.12] gh-124030: Skip test_tcsendbreak on NetBSD for ENOTTY error (GH-124031) (GH-124062)
(cherry picked from commit 9f42b62db9)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2024-09-13 16:44:57 +00:00
Miss Islington (bot)
b6f4607351
[3.12] gh-123811: Test that round(Decimal) can return signed zero (GH-124007) (GH-124049)
(cherry picked from commit b46c65ed2b)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-09-13 13:09:26 +00:00
Miss Islington (bot)
9e93556f0a
[3.12] gh-123935: Fix typo in _get_slots in dataclasses.py (GH-123941) (#123992)
gh-123935: Fix typo in `_get_slots` in `dataclasses.py` (GH-123941)
(cherry picked from commit ac918ccad7)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-09-12 07:48:01 +00:00
Miss Islington (bot)
8ca75eecb0
[3.12] gh-123811: test that round() can return signed zero (GH-123829) (#123939)
gh-123811: test that round() can return signed zero (GH-123829)
(cherry picked from commit d2b9b6f919)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-09-11 12:26:35 +00:00
Sergey B Kirpichev
ec119dc984
[3.12] gh-121039: add Floats/ComplexesAreIdenticalMixin to test.support.testcase (GH-121071) (#123841)
* [3.12] gh-121039: add Floats/ComplexesAreIdenticalMixin to test.support.testcase (GH-121071)
(cherry picked from commit 8ef8354ef1)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-09-11 14:06:40 +02:00
Serhiy Storchaka
90e5bd7ed2
[3.12] gh-77894: Fix a crash when the GC breaks a loop containing a memoryview (GH-123898) (GH-123937)
Now a memoryview object can only be cleared if there are no buffers
that refer it.
(cherry picked from commit a1dbf2ea69)
2024-09-11 09:32:39 +00:00
Miss Islington (bot)
de20ad9683
[3.12] gh-123881: Add additional test coverage for PEP 695 edge cases (GH-123886) (#123891)
gh-123881: Add additional test coverage for PEP 695 edge cases (GH-123886)
(cherry picked from commit b52de7e02d)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-09-10 06:27:50 -07:00
Victor Stinner
8b16ec65a2
[3.12] Fix typos (#123775) (#123867)
Fix typos (#123775)

(cherry picked from commit 9017b95ff2)

Co-authored-by: algonell <algonell@gmail.com>
2024-09-09 13:22:13 +00:00
Miss Islington (bot)
917f2c8422
[3.12] gh-123823: Fix test_posix for unsupported posix_fallocate on NetBSD (GH-123824) (#123865)
gh-123823: Fix test_posix for unsupported posix_fallocate on NetBSD (GH-123824)

Fix test_posix for unsupported posix_fallocate on NetBSD.
(cherry picked from commit df4f0cbfad)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2024-09-09 12:47:05 +00:00
Miss Islington (bot)
349cc27ca9
[3.12] gh-123780: Make test_pkgutil clean up spam module (GH-123036) (GH-123782)
(cherry picked from commit eca3fe40c2)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2024-09-09 13:18:42 +02:00
Miss Islington (bot)
e0c69e479c
[3.12] gh-122792: Make IPv4-mapped IPv6 address properties consistent with IPv4 (GH-122793) (GH-123814)
gh-122792: Make IPv4-mapped IPv6 address properties consistent with IPv4 (GH-122793)

Make IPv4-mapped IPv6 address properties consistent with IPv4.
(cherry picked from commit 76a1c5d183)

Co-authored-by: Seth Michael Larson <seth@python.org>
2024-09-07 18:22:54 +00:00
Miss Islington (bot)
94682423c2
[3.12] gh-123309: Add more tests for the pickletools module (GH-123355) (#123534)
Add tests for genops() and dis().
(cherry picked from commit e5a567b0a7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-06 15:51:16 +02:00
Miss Islington (bot)
58e01a1c7f
[3.12] gh-123431: Harmonize extension code checks in pickle (GH-123434) (#123460)
This checks are redundant in normal circumstances and can only work if
the extension registry was intentionally broken.

(cherry picked from commit 0c3ea30238)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-06 15:50:27 +02:00
Miss Islington (bot)
10adcb4a2b
[3.12] gh-122798: Make tests for warnings in the re module more strict (GH-122799) (#122805)
(cherry picked from commit d2e5be1f39)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-06 15:49:35 +02:00
Miss Islington (bot)
0edfc668e7
[3.12] gh-85110: Preserve relative path in URL without netloc in urllib.parse.urlunsplit() (GH-123179) (#123188)
(cherry picked from commit 90c892efea)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-06 15:48:23 +02:00
Miss Islington (bot)
7cb8d28e50
[3.12] gh-116263: Do not rollover empty files in RotatingFileHandler (GH-122788) (#122815)
(cherry picked from commit 6094c6fc2f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-06 15:47:42 +02:00
Sam Gross
1bfb58cf2f
[3.12] gh-122527: Fix a crash on deallocation of PyStructSequence (GH-122577) (#122626)
The `PyStructSequence` destructor would crash if it was deallocated after
its type's dictionary was cleared by the GC, because it couldn't compute
the "real size" of the instance. This could occur with relatively
straightforward code in the free-threaded build or with a reference
cycle involving the type in the default build, due to differing orders
in which `tp_clear()` was called.

Account for the non-sequence fields in `tp_basicsize` and use that,
along with `Py_SIZE()`, to compute the "real" size of a
`PyStructSequence` in the dealloc function. This avoids the accesses to
the type's dictionary during dealloc, which were unsafe.
(cherry picked from commit 4b63cd170e)
2024-09-06 15:46:56 +02:00
Petr Viktorin
15068242bd
[3.12] [CVE-2023-27043] gh-102988: Reject malformed addresses in email.parseaddr() (GH-111116) (#123766)
Detect email address parsing errors and return empty tuple to
indicate the parsing error (old API). Add an optional 'strict'
parameter to getaddresses() and parseaddr() functions. Patch by
Thomas Dwyer.

Co-Authored-By: Thomas Dwyer <github@tomd.tel>
(cherry picked from commit 4a153a1d3b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-09-06 12:46:16 +02:00
Miss Islington (bot)
919a3e8028
[3.12] gh-123048: Fix missing source location in pattern matching code (GH-123167) (#123170)
gh-123048: Fix missing source location in pattern matching code (GH-123167)
(cherry picked from commit bffed80230)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-09-06 10:43:05 +00:00
Miss Islington (bot)
747abc00d0
[3.12] gh-123213: Fixed xml.etree.ElementTree.Element.extend and assignment to no longer hide exceptions (GH-123214) (#123258)
Co-authored-by: Bar Harel <bharel@barharel.com>
2024-09-06 11:51:18 +03:00
Sergey B Kirpichev
1d8ab25742
[3.12] gh-111495: Add tests for PyNumber C API (GH-111996) (#123376)
(cherry picked from commit 2f20f5a9bc)
2024-09-06 00:51:26 +02:00
Sergey B Kirpichev
625072f76e
[3.12] gh-111495: Add tests for PyTuple C API (GH-118757) (#123379)
(cherry picked from commit dbc1752d41)

Co-authored-by: kalyanr <kalyan.ben10@live.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-09-06 00:51:02 +02:00
Miss Islington (bot)
562ff730f3
[3.12] gh-123321: Fix Parser/myreadline.c to prevent a segfault during a multi-threaded race (GH-123323) (#123677)
* gh-123321: Fix Parser/myreadline.c to prevent a segfault during a multi-threaded race (GH-123323)
(cherry picked from commit a4562fedad)

Co-authored-by: Bar Harel <bharel@barharel.com>

* Remove @requires_gil_enabled for 3.12

---------

Co-authored-by: Bar Harel <bharel@barharel.com>
Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-09-05 14:25:38 +02:00
Donghee Na
4514998195
[3.12] gh-101525: Skip test_gdb if the binary is relocated by BOLT. (… (#123603)
[3.12] gh-101525: Skip test_gdb if the binary is relocated by BOLT. (gh-118572)
(cherry picked from commit f95fc4de11)
2024-09-03 00:37:26 +09:00
Miss Islington (bot)
22ec9cb823
[3.12] gh-93691: fix too broad source locations of with-statement instructions (GH-120125) (#123605)
gh-93691: fix too broad source locations of with-statement instructions (GH-120125)
(cherry picked from commit eca3f7762c)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-09-02 14:45:09 +00:00
Miss Islington (bot)
95b073bdde
[3.12] gh-123270: Replaced SanitizedNames with a more surgical fix. (GH-123354) (#123411)
gh-123270: Replaced SanitizedNames with a more surgical fix. (GH-123354)

Applies changes from zipp 3.20.1 and jaraco/zippGH-124
(cherry picked from commit 2231286d78)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-09-02 09:19:40 -04:00
Miss Islington (bot)
12db938d43
[3.12] gh-91126: Docs and tests for slotted dataclasses with __init_subclass__ (GH-123342) (#123569)
gh-91126: Docs and tests for slotted dataclasses with `__init_subclass__` (GH-123342)
(cherry picked from commit 75e72822a3)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-09-01 10:44:15 +00:00
Miss Islington (bot)
4eaf4891c1
[3.12] gh-121285: Remove backtracking when parsing tarfile headers (GH-121286) (GH-123543)
gh-121285: Remove backtracking when parsing tarfile headers (GH-121286)

* Remove backtracking when parsing tarfile headers
* Rewrite PAX header parsing to be stricter
* Optimize parsing of GNU extended sparse headers v0.0

(cherry picked from commit 34ddb64d08)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-08-31 22:35:24 +00:00
Irit Katriel
0181aa2e3e
[3.12] gh-123142: fix too wide source location of GET_ITER/GET_AITER (GH-123420). (#123436)
(cherry picked from commit 61bef6245c)
2024-08-28 18:41:40 +01:00
Miss Islington (bot)
ccc6c2b8c0
[3.12] gh-120226: Fix test_sendfile_close_peer_in_the_middle_of_receiving on Linux >= 6.10 (GH-120227) (#123422)
gh-120226: Fix test_sendfile_close_peer_in_the_middle_of_receiving on Linux >= 6.10 (GH-120227)

The worst case is that the kernel buffers 17 pages with a page size of 64k.
(cherry picked from commit a758424566)

Co-authored-by: Xi Ruoyao <xry111@xry111.site>
2024-08-28 12:47:41 +00:00
Miss Islington (bot)
dcc3eaef98
[3.12] gh-123067: Fix quadratic complexity in parsing "-quoted cookie values with backslashes (GH-123075) (#123104)
gh-123067: Fix quadratic complexity in parsing "-quoted cookie values with backslashes (GH-123075)

This fixes CVE-2024-7592.
(cherry picked from commit 44e458357f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-08-24 15:37:11 -07:00
Serhiy Storchaka
8fe586d27a
[3.12] gh-122478: Remove internal frames from tracebacks in REPL (GH-122528) (GH-122816)
Frames of methods in code and codeop modules was show with non-default
sys.excepthook.

Save correct tracebacks in sys.last_traceback and update __traceback__
attribute of sys.last_value and sys.last_exc.
(cherry picked from commit e73e7a7abd)
2024-08-23 09:27:03 +03:00
Donghee Na
6e6855950a
[3.12] gh-123083: Fix a potential use-after-free in ``STORE_ATTR_WITH… (#123237)
[3.12] gh-123083: Fix a potential use-after-free in ``STORE_ATTR_WITH_HINT`` (gh-123092)
(cherry picked from commit 297f2e093e)
2024-08-23 01:37:40 +09:00
Irit Katriel
fbbde4dc6a
[3.12] gh-123142: Fix too wide source locations in tracebacks of exceptions from broken iterables in comprehensions (GH-123173). (#123210)
(cherry picked from commit ec89620e5e)
2024-08-22 10:22:43 +01:00
Miss Islington (bot)
030b48c27a
[3.12] gh-116789: Add more tests for inspect.getmembers (GH-116802) (#123130)
gh-116789: Add more tests for `inspect.getmembers` (GH-116802)
(cherry picked from commit c15bfa9a71)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-08-18 19:18:53 +03:00
Miss Islington (bot)
41090b7ba0
[3.12] gh-112182: Replace StopIteration with RuntimeError for future (GH-113220) (GH-123033)
When an `StopIteration` raises into `asyncio.Future`, this will cause
a thread to hang. This commit address this by not raising an exception
and silently transforming the `StopIteration` with a `RuntimeError`,
which the caller can reconstruct from `fut.exception().__cause__`
(cherry picked from commit 4826d52338)

Co-authored-by: Jamie Phan <jamie@ordinarylab.dev>
2024-08-15 15:34:53 +00:00
Miss Islington (bot)
c3ee1a7f05
[3.12] gh-122255: Add black box tests in test_warnings (GH-122227) (GH-122819)
They are similar to white box tests for gh-86298 in test_importlib.
(cherry picked from commit fe13c9baf4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-08-14 14:12:34 +00:00
Miss Islington (bot)
0585a3fdb9
[3.12] gh-99437: runpy: decode path-like objects before setting globals (#114838)
Co-authored-by: Kamil Turek <kamil.turek@hotmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-08-12 11:22:13 +03:00
Jason R. Coombs
f511a939b0
[3.12] gh-122903: Honor directories in zipfile.Path.glob. (GH-122908) (#122927)
(cherry picked from commit 6aa35f3002)
2024-08-12 01:03:03 +00:00
Miss Islington (bot)
dcc5182f27
[3.12] gh-122905: Sanitize names in zipfile.Path. (GH-122906) (#122923) 2024-08-11 20:35:17 -04:00
Miss Islington (bot)
9d7209fc93
[3.12] gh-113785: csv: fields starting with escapechar are not quoted (GH-122110) (GH-122259)
(cherry picked from commit a3327dbfd4)

Co-authored-by: Mikołaj Kuranowski <mkuranowski@gmail.com>
2024-08-09 16:04:29 +00:00
Victor Stinner
c57a33d006
[3.12] gh-122695: Fix double-free when using gc.get_referents with a freed _asyncio.FutureIter (#122837) (#122859)
[3.13] gh-122695: Fix double-free when using `gc.get_referents` with a freed `_asyncio.FutureIter` (#122837)

* Backport #122834 for 3.13

(cherry picked from commit e8fb088dba)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-08-09 14:33:24 +00:00
Miss Islington (bot)
c536f59c62
[3.12] gh-122744: test_venv: ignore pip's complaint about missing ssl (GH-122776) (GH-122822)
(cherry picked from commit 0d9c123d1a)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-08-09 09:27:11 +02:00
Serhiy Storchaka
f2cc8ad989
[3.12] gh-118814: Fix the TypeVar constructor when name is passed by keyword (GH-122664) (GH-122807)
Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for
positional-or-keyword parameter is passed by keyword.
There was only one such case in the stdlib -- the TypeVar constructor.
(cherry picked from commit 540fcc62f5)
2024-08-08 09:49:50 +03:00
Miss Islington (bot)
b895f1804f
[3.12] gh-122334: Fix test_embed failure when missing _ssl module (GH-122630) (#122648)
gh-122334: Fix test_embed failure when missing _ssl module (GH-122630)
(cherry picked from commit 50b3603751)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
Co-authored-by: Wulian233 <1055917385@qq.com>
2024-08-06 20:59:55 +02:00
Gregory P. Smith
b31764104e
[3.12] gh-119577: Adjust DeprecationWarning when testing element truth values in Element tree (GH-119762) (#120190)
gh-119577: Adjust DeprecationWarning when testing element truth values in ElementTree (GH-119762)

Adjust DeprecationWarning when testing element truth values in
ElementTree, we're planning to go with the more natural True return
rather than a disruptive harder to code around exception raise, and are
deferring the behavior change for a few more releases.

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2024-08-06 17:20:06 +00:00