Commit graph

30702 commits

Author SHA1 Message Date
Miss Islington (bot)
1d70dd257b
[3.12] gh-119004: fix a crash in equality testing between OrderedDict (GH-121329) (#124508)
gh-119004: fix a crash in equality testing between `OrderedDict` (GH-121329)
(cherry picked from commit 38a887dc3e)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-09-27 11:33:44 -07:00
Bénédikt Tran
373036a82c
[3.12] gh-89683: add tests for deepcopy on frozen dataclasses (GH-123098) (gh-124679)
gh-89683: add tests for `deepcopy` on frozen dataclasses (gh-123098)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2024-09-27 16:57:30 +00:00
Miss Islington (bot)
4d38254e20
[3.12] gh-86673: Harden test_ttk.test_element_create_image (GH-123335) (#124655)
(cherry picked from commit 08e1bbe4a3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-27 06:48:00 +00:00
Miss Islington (bot)
a0c90b36f6
[3.12] gh-124378: Update test_ttk for Tcl/Tk 8.6.15 (GH-124545)
(cherry picked from commit fb6bd31cb7)

Co-authored-by: Zachary Ware <zach@python.org>
Co-authored-by: Marc Culler <culler@users.noreply.github.com>
2024-09-26 11:20:09 -05:00
Miss Islington (bot)
4659026e1d
[3.12] gh-124498: Fix TypeAliasType not to be generic, when type_params=() (GH-124499) (#124604)
gh-124498: Fix `TypeAliasType` not to be generic, when `type_params=()` (GH-124499)
(cherry picked from commit abe5f799e6)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-09-26 14:46:29 +00:00
Kumar Aditya
2b54a4ebf1
[3.12] gh-124309: Modernize the staggered_race implementation to support e… (#124574)
gh-124309: Modernize the `staggered_race` implementation to support eager task factories (#124390)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
(cherry picked from commit de929f353c)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-09-26 05:39:46 +00:00
Jason R. Coombs
c60d97805f
[3.12] gh-121735: Fix module-adjacent references in zip files (gh-123037) (#124011) 2024-09-24 10:19:43 -07:00
Miss Islington (bot)
996e409401
[3.12] gh-59317: Improve parsing optional positional arguments in argparse (GH-124303) (GH-124437)
Fix parsing positional argument with nargs equal to '?' or '*' if it is
preceded by an option and another positional argument.
(cherry picked from commit 4a5e4aade4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-24 13:08:22 +00:00
Serhiy Storchaka
18542240c2
[3.12] gh-124188: Fix PyErr_ProgramTextObject() (GH-124189) (GH-124426)
* Detect source file encoding.
* Use the "replace" error handler even for UTF-8 (default) encoding.
* Remove the BOM.
* Fix detection of too long lines if they contain NUL.
* Return the head rather than the tail for truncated long lines.
(cherry picked from commit e2f710792b)
2024-09-24 08:53:54 +00:00
Miss Islington (bot)
7e2d414a59
[3.12] gh-72795: Make positional arguments with nargs='*' or REMAINDER non-required (GH-124306) (GH-124422)
This allows to use positional argument with nargs='*' and without default
in mutually exclusive group and improves error message about required
arguments.
(cherry picked from commit 3c83f9958c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-24 11:43:26 +03:00
Miss Islington (bot)
0e838b52fe
[3.12] gh-53780: Ignore the first "--" (double dash) between an option and command in argparse (GH-124275) (GH-124420)
(cherry picked from commit c578271366)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-24 07:54:32 +00:00
Miss Islington (bot)
e57fbe3d2d
[3.12] gh-63143: Fix parsing mutually exclusive arguments in argparse (GH-124307) (GH-124419)
Arguments with the value identical to the default value (e.g. booleans,
small integers, empty or 1-character strings) are no longer considered
"not present".
(cherry picked from commit 3094cd17b0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-24 07:42:34 +00:00
Miss Islington (bot)
1366fff609
[3.12] gh-124130: Increase test coverage for \b and \B in regular expressions (GH-124330) (GH-124414)
(cherry picked from commit b82f07653e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-24 06:56:45 +00:00
Alex Waygood
4b221bf878
[3.12] Bump Ruff to 0.6.7 (#124384) (#124391) 2024-09-23 23:09:27 +00:00
Miss Islington (bot)
7cc773ba3d
[3.12] GH-87041: Fix incorrect indentation in argparse help (GH-124230) (GH-124374)
In case of usage a long command along with max_help_position more than
the length of the command, the command's help was incorrectly started
on the new line.

(cherry picked from commit 7ee9921734)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
Co-authored-by: Pavel Ditenbir <pavel.ditenbir@gmail.com>
2024-09-23 20:16:45 +00:00
Miss Islington (bot)
25312403de
[3.12] gh-95468: Add more tests for "--" (double dash) in test_argparse (GH-124274) (GH-124276)
(cherry picked from commit baa3550bc3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-22 20:42:14 +03:00
Miss Islington (bot)
fcfe78664b
[3.12] gh-124217, ipaddress: Add RFC 9637 reserved IPv6 block 3fff::/20 (GH-124240) (#124283)
gh-124217, ipaddress: Add RFC 9637 reserved IPv6 block `3fff::/20` (GH-124240)
(cherry picked from commit db6eb3640a)

Signed-off-by: y5c4l3 <y5c4l3@proton.me>
Co-authored-by: Y5 <124019959+y5c4l3@users.noreply.github.com>
2024-09-20 14:20:27 +02:00
Miss Islington (bot)
6644cd2c1b
[3.12] gh-124248: Fix crash in struct when processing 0p fields (GH-124251) (#124278)
gh-124248: Fix crash in struct when processing 0p fields (GH-124251)
(cherry picked from commit 63f196090f)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2024-09-20 10:29:43 +00:00
Miss Islington (bot)
6c6b044304
[3.12] gh-81691: Fix handling of multiple "--" (double dashes) in argparse (GH-124233) (GH-124267)
Only the first one has now been removed, all subsequent ones are now
taken literally.
(cherry picked from commit aae126748f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-20 13:02:30 +03:00
Miss Islington (bot)
eca08d3687
[3.12] gh-124040: Adjust few tests in testHypot/testDist to get exactly computed results (GH-124042) (GH-124236)
(cherry picked from commit 4420cf4dc9)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-09-19 08:30:19 +00:00
Miss Islington (bot)
e9578f6424
[3.12] gh-123934: Fix MagicMock not to reset magic method return values (GH-124038) (#124232)
gh-123934: Fix `MagicMock` not to reset magic method return values (GH-124038)
(cherry picked from commit 7628f67d55)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-09-19 08:18:01 +00:00
Miss Islington (bot)
a82a2f1597
[3.12] gh-124083: Skip test_signal.test_strsignal() on NetBSD (GH-124084) (#124224)
gh-124083: Skip test_signal.test_strsignal() on NetBSD (GH-124084)

Skip test_strsignal() on NetBSD due to TypeError.
(cherry picked from commit 36682c0914)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2024-09-18 21:47:18 +00:00
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