Commit graph

53284 commits

Author SHA1 Message Date
Ethan Furman
875e49fb63
[3.13] gh-112328: Make EnumDict usable on its own and document it (GH-123669) (GH-128142)
Co-authored-by: Petr Viktorin <pviktori@redhat.com>
2024-12-24 10:50:23 -08:00
Miss Islington (bot)
e1a0c40658
[3.13] gh-127847: Fix position in the special-cased zipfile seek (GH-127856) (#128225)
gh-127847: Fix position in the special-cased zipfile seek (GH-127856)

---------
(cherry picked from commit 7ed6c5c696)

Co-authored-by: Dima Ryazanov <dima@bucket.xxx>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-12-24 16:20:58 +00:00
Miss Islington (bot)
09d15aa9a8
[3.13] gh-128049: Fix type confusion bug with the return value of a custom ExceptionGroup split function (GH-128079) (#128139)
gh-128049: Fix type confusion bug with the return value of a custom ExceptionGroup split function (GH-128079)
(cherry picked from commit 3879ca0100)

Co-authored-by: Nico-Posada <102486290+Nico-Posada@users.noreply.github.com>
2024-12-20 20:18:44 +00:00
Miss Islington (bot)
43586a4804
[3.13] gh-128116: Skip test_socket VSOCK testStream() on PermissionError (GH-128120) (#128123)
gh-128116: Skip test_socket VSOCK testStream() on PermissionError (GH-128120)
(cherry picked from commit cbfe3023e4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-20 13:32:58 +00:00
Miss Islington (bot)
f320f747da
[3.13] gh-128030: Avoid error from PyModule_GetFilenameObject for non-module (GH-128047) (#128114)
gh-128030: Avoid error from PyModule_GetFilenameObject for non-module (GH-128047)

I missed the extra `PyModule_Check` in GH-127660 because I was looking at
3.12 as the base implementation for import from. This meant that I
missed the `PyModuleCheck` introduced in GH-112661.
(cherry picked from commit 45e6dd63b8)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2024-12-20 08:46:54 +00:00
Peter Bierma
3a8bdaf698
[3.13] gh-128083: Fix macro redefinition warning in clinic. (GH-127950) (#128102)
(cherry picked from commit b5d1e4552f)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-12-19 21:29:14 +00:00
Miss Islington (bot)
a0f1f120f2
[3.13] gh-128062: Fix the font size and shortcut display of the turtledemo menu (GH-128063) (#128101)
gh-128062: Fix the font size and shortcut display of the turtledemo menu (GH-128063)

Leave the font of the menu bar the default to keep it consistent with the rest of the world. Display the shortcut keys in the right way, using the 'accelerator' option.
---------

(cherry picked from commit e163e8d4e1)

Co-authored-by: Zhikang Yan <2951256653@qq.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-12-19 20:47:24 +00:00
Miss Islington (bot)
2ff3e95ad5
[3.13] gh-126742: Avoid checking for library filename in test_ctypes (GH-128034) (#128056)
gh-126742: Avoid checking for library filename in test_ctypes (GH-128034)

Avoid checking for library filename in `dlerror()` error messages of test_ctypes.
(cherry picked from commit 335e24fb0a)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-12-18 08:49:13 +00:00
Miss Islington (bot)
f8b4e20137
[3.13] gh-127060: Disable traceback colors in IDLE (GH-128028) (#128052)
Set TERM environment variable to "dumb" to disable traceback colors
in IDLE, since IDLE doesn't understand ANSI escape sequences.

(cherry picked from commit 559b0e7013)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-18 05:58:57 +00:00
Miss Islington (bot)
fe08cdf265
[3.13] gh-126742: Add _PyErr_SetLocaleString, use it for gdbm & dlerror messages (GH-126746) (GH-128023)
- Add a helper to set an error from locale-encoded `char*`
- Use the helper for gdbm & dlerror messages
(cherry picked from commit 7303f06846)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-17 11:45:29 +00:00
Miss Islington (bot)
90ae4b6f5a
[3.13] gh-127353: Allow to force color output on Windows V2 (GH-127926) (#127944)
gh-127353: Allow to force color output on Windows V2 (GH-127926)
(cherry picked from commit 0ac40acec0)

Co-authored-by: Andrey Efremov <duxus@yandex.ru>
2024-12-15 10:41:11 +02:00
Victor Stinner
2996a2bed3
[3.13] gh-127906: Backport test_cext changes from the main branch (#127923) 2024-12-13 15:04:08 +00:00
Miss Islington (bot)
78095c9052
[3.13] gh-127906: Test the limited C API in test_cppext (GH-127916) (#127919)
gh-127906: Test the limited C API in test_cppext (GH-127916)
(cherry picked from commit d05a4e6a0d)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-13 14:12:07 +00:00
Miss Islington (bot)
0f38b897f9
[3.13] gh-127870: Detect recursive calls in ctypes _as_parameter_ handling (GH-127872) (#127917)
gh-127870: Detect recursive calls in ctypes _as_parameter_ handling (GH-127872)
(cherry picked from commit 6ff38fc4e2)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-13 13:19:41 +00:00
Victor Stinner
b620e503eb
[3.13] gh-127906: Backport test_cppext changes from the main branch (#127914) 2024-12-13 12:51:48 +00:00
Miss Islington (bot)
d68c9416cf
[3.13] Fix typos in Lib/_pydecimal.py (GH-127700) (#127887)
Fix typos in `Lib/_pydecimal.py` (GH-127700)
(cherry picked from commit ed037d229f)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2024-12-12 20:49:09 +00:00
Petr Viktorin
d51c1444e3
[3.13] gh-126937: ctypes: add test for maximum size of a struct field (GH-126938) (GH-127825)
This backports the *test* from GH-126938, with changed limit and exception class.

Co-authored-by: Melissa0x1f992 <70096546+Melissa0x1f992@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-12-12 13:02:57 +01:00
Miss Islington (bot)
a94e20e4f1
[3.13] gh-123401: Fix http.cookies module to support obsolete RFC 850 date format (GH-123405) (#127828)
gh-123401: Fix http.cookies module to support obsolete RFC 850 date format (GH-123405)
(cherry picked from commit 359389ed51)

Co-authored-by: Nano <nanoapezlk@gmail.com>
Co-authored-by: Wulian <1055917385@qq.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-11 15:38:09 +00:00
Bénédikt Tran
8bf5b89212
[3.13] gh-127637: add tests for dis command-line interface (#127759) (#127781) 2024-12-10 12:32:32 +00:00
Miss Islington (bot)
9d0252ff2e
[3.13] gh-126775: make linecache.checkcache threadsafe and GC re-entrency safe (GH-126776) (#127778)
gh-126775: make linecache.checkcache threadsafe and GC re-entrency safe (GH-126776)

(cherry picked from commit 2233c303e4)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bartosz Sławecki <bartoszpiotrslawecki@gmail.com>
2024-12-10 08:06:26 +00:00
Shantanu
6441d42f92
[3.13] gh-127651: Use __file__ in diagnostics if origin is missing (#127660) (#127775)
gh-127651: Use __file__ in diagnostics if origin is missing (#127660)

See the left hand side in https://github.com/python/cpython/pull/123929/files#diff-c22186367cbe20233e843261998dc027ae5f1f8c0d2e778abfa454ae74cc59deL2840-L2849

---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 3983527c3a)
2024-12-10 05:21:55 +00:00
Miss Islington (bot)
310efdabf5
gh-127732: Add Windows Server 2025 detection to platform module (GH-127733)
(cherry picked from commit 5eb7fd4d0f)

Co-authored-by: Wulian <1055917385@qq.com>
2024-12-09 12:50:34 +00:00
Russell Keith-Magee
075c41d5f5
[3.13] gh-126925: Modify how iOS test results are gathered (GH-127592) (#127754)
Adds a `use_system_log` config item to enable stdout/stderr redirection for
Apple platforms. This log streaming is then used by a new iOS test runner
script, allowing the display of test suite output at runtime. The iOS test
runner script can be used by any Python project, not just the CPython test
suite.
(cherry picked from commit 2041a95e68)
2024-12-09 14:39:11 +08:00
Miss Islington (bot)
b56100c77a
[3.13] gh-127734: improve signature of urllib.request.HTTPPasswordMgrWithPriorAuth.__init__ (GH-127735) (#127744)
gh-127734: improve signature of `urllib.request.HTTPPasswordMgrWithPriorAuth.__init__` (GH-127735)

improve signature of urllib.request.HTTPPasswordMgrWithPriorAuth.__init__
(cherry picked from commit a03efb533a)

Co-authored-by: Stephen Morton <git@tungol.org>
2024-12-08 12:15:35 -08:00
Miss Islington (bot)
2ba5190f01
[3.13] Give poplib.POP3.rpop a proper docstring (GH-127370) (#127721)
Give `poplib.POP3.rpop` a proper docstring (GH-127370)

Previously `poplib.POP3.rpop` had a "Not sure what this does" docstring, now it has been fixed.
(cherry picked from commit 27d0d21413)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2024-12-07 16:41:23 +00:00
Miss Islington (bot)
d95df6a75b
[3.13] Fix typo in Lib/_android_support.py (GH-127699) (#127703)
Fix typo in `Lib/_android_support.py` (GH-127699)
(cherry picked from commit e59caf67cd)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2024-12-06 18:14:12 +00:00
Miss Islington (bot)
652a0eb6d1
[3.13] gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime.strptime patterns (GH-127590) GH-127650)
gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime.strptime patterns (GH-127590)

The code has required 4 digits for the year since its inclusion in the stdlib in 2002 (over 22 years ago as of this commit).
(cherry picked from commit 51cfa569e3)

Co-authored-by: Beomsoo Kim <beoms424@gmail.com>
2024-12-06 09:17:32 -08:00
Miss Islington (bot)
71e8429ac8
[3.13] gh-127655: Ensure _SelectorSocketTransport.writelines pauses the protocol if needed (GH-127656) (#127663)
gh-127655: Ensure `_SelectorSocketTransport.writelines` pauses the protocol if needed (GH-127656)

Ensure `_SelectorSocketTransport.writelines` pauses the protocol if it reaches the high water mark as needed.
(cherry picked from commit e991ac8f20)

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-12-06 10:42:23 +05:30
Miss Islington (bot)
2da829ba97
[3.13] GH-126727: Fix test_era_nl_langinfo with Japanese ERAs on Solaris (GH-127327) (GH-127645)
(cherry picked from commit d958d9f4a1)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2024-12-05 19:08:12 +00:00
Miss Islington (bot)
468e8dad7e
[3.13] gh-122431: Disallow negative values in readline.append_history_file (GH-122469) (#127641)
gh-122431: Disallow negative values in `readline.append_history_file` (GH-122469)
(cherry picked from commit 208b0fb645)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-05 18:15:44 +01:00
Thomas Wouters
b90161f62c Merge branch '3.13' of https://github.com/python/cpython into 3.13 2024-12-03 22:43:45 +01:00
Miss Islington (bot)
0b266aaa39
[3.13] gh-127421: Fix race in test_start_new_thread_failed (GH-127549) (#127574)
gh-127421: Fix race in test_start_new_thread_failed (GH-127549)

Fix race in test_start_new_thread_failed

When we succeed in starting a new thread, for example if setrlimit
was ineffective, we must wait for the newly spawned thread to exit.
Otherwise, we run the risk that the newly spawned thread will race
with runtime finalization and access memory that has already been
clobbered/freed.

`_thread.start_new_thread()` only spawns daemon threads, which the runtime
does not wait for at shutdown, and does not return a handle. Use
`_thread.start_joinable_thread()` and join the resulting handle when
the thread is started successfully.
(cherry picked from commit 13b68e1a61)

Co-authored-by: mpage <mpage@meta.com>
2024-12-03 10:30:08 -08:00
Thomas Wouters
0671451779 Python 3.13.1 2024-12-03 18:59:52 +01:00
Miss Islington (bot)
dddea7c232
[3.13] gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952) (#122984)
gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952)

As of 529a160 (gh-118204), building with HAVE_DYNAMIC_LOADING stopped working.  This is a minimal fix just to get builds working again.  There are actually a number of long-standing deficiencies with HAVE_DYNAMIC_LOADING builds that need to be resolved separately.
(cherry picked from commit ee1b8ce26e)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-12-03 16:46:30 +00:00
Miss Islington (bot)
ae3f347dc0
[3.13] gh-123935: Fix typo in _get_slots in dataclasses.py (GH-123941) (#123991)
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-12-03 17:17:25 +01:00
Miss Islington (bot)
a63e06d95b
[3.13] gh-122792: Make IPv4-mapped IPv6 address properties consistent with IPv4 (GH-122793) (GH-123815)
Make IPv4-mapped IPv6 address properties consistent with IPv4.
(cherry picked from commit 76a1c5d183)

Co-authored-by: Seth Michael Larson <seth@python.org>
2024-12-03 17:12:36 +01:00
Miss Islington (bot)
a853610282
gh-119826: Improved fallback for ntpath.abspath() on Windows (GH-119938)
(cherry picked from commit 4b00aba42e)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-12-02 20:11:16 +00:00
Eric Snow
219b8266db
[3.13] gh-126914: Store the Preallocated Thread State's Pointer in a PyInterpreterState Field (gh-127114)
This approach eliminates the originally reported race.  It also gets rid of the deadlock reported in gh-96071, so we can remove the workaround added then.

This is mostly a cherry-pick of 1c0a104 (AKA gh-126989).  The difference is we add PyInterpreterState.threads_preallocated at the end of PyInterpreterState, instead of adding PyInterpreterState.threads.preallocated.  That avoids ABI disruption.
2024-12-02 18:41:57 +00:00
Miss Islington (bot)
059114c0a0
[3.13] gh-126876: Fix socket internal_select() for large timeout (GH-126968) (#127002)
gh-126876: Fix socket internal_select() for large timeout (GH-126968)

If the timeout is larger than INT_MAX, replace it with INT_MAX, in
the poll() code path.

Add an unit test.
(cherry picked from commit b3687ad454)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-02 16:25:55 +00:00
Miss Islington (bot)
f41d8d89e7
[3.13] gh-113841: fix possible undefined division by 0 in _Py_c_pow() (GH-127211) (#127216)
Note, that transformed expression is not an equivalent for original one (1/exp(-x) != exp(x) in general for floating-point numbers). Though, the difference seems to be ~1ULP for good libm implementations.

It's more interesting why division was used from beginning. Closest algorithm I've found (no error checks, of course;)) - it's Algorithm 190 from ACM: https://dl.acm.org/doi/10.1145/366663.366679. It uses subtraction in the exponent.

(cherry picked from commit f7bb658124)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-12-02 15:42:02 +01:00
Miss Islington (bot)
511c588f5d
[3.13] add missing gc_collect() calls in sqlite3 tests (GH-127446) (#127500)
add missing gc_collect() calls in sqlite3 tests (GH-127446)
(cherry picked from commit 2a373da770)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
2024-12-02 15:19:21 +01:00
Miss Islington (bot)
a5672bec68
[3.13] gh-126699: allow AsyncIterator to be used as a base for Protocols (GH-126702) (#126762)
gh-126699: allow AsyncIterator to be used as a base for Protocols (GH-126702)
(cherry picked from commit feb3e0b19c)

Co-authored-by: Stephen Morton <github@tungol.org>
2024-12-02 15:10:25 +01:00
Miss Islington (bot)
fd48d98df9
[3.13] gh-125666: Avoid PyREPL exiting when a null byte is in input (GH-125732) (#126023)
gh-125666: Avoid PyREPL exiting when a null byte is in input (GH-125732)
(cherry picked from commit 44becb8cba)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
2024-12-02 15:04:51 +01:00
Peter Bierma
b1051577de
[3.13] gh-124984: Enhance ssl thread safety (GH-124993) (#125780)
Make SSL objects thread safe in Free Theaded build by
using critical sections.

(cherry picked from commit 4c53b25775)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-12-02 15:03:44 +01:00
Miss Islington (bot)
4bafce0912
[3.13] gh-126618: fix repr(itertools.count(sys.maxsize)) (GH-127048) (#127508)
gh-126618: fix repr(itertools.count(sys.maxsize)) (GH-127048)
(cherry picked from commit 930ba0ce60)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-12-02 13:38:13 +00:00
Tian Gao
dd2ad70b29
[3.13] gh-127321: Avoid stopping at an opcode without an associated line number for breakpoint() (GH-127457) (#127487)
(cherry picked from commit 1bc4f076d1)
2024-12-01 17:58:08 -05:00
Miss Islington (bot)
06acb95856
[3.13] Add the missing f on an f-string error message in multiprocessing. (GH-127462) (#127464)
Add the missing `f` on an f-string error message in multiprocessing. (GH-127462)
(cherry picked from commit 11c01092d5)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-11-30 23:50:01 -08:00
Miss Islington (bot)
2813a61675
[3.13] gh-127165: Disallow embedded NULL characters in _interpreters (GH-127199) (#127463)
gh-127165: Disallow embedded NULL characters in `_interpreters` (GH-127199)
(cherry picked from commit 46bfd26fb2)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-12-01 06:55:55 +00:00
Miss Islington (bot)
5017c81824
[3.13] gh-127190: Fix local_setattro() error handling (GH-127366) (#127367)
gh-127190: Fix local_setattro() error handling (GH-127366)

Don't make the assumption that the 'name' argument is a string. Use
repr() to format the 'name' argument instead.
(cherry picked from commit 20657fbdb1)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-01 06:48:04 +00:00
Peter Bierma
a442c87c4c
[3.13] gh-127341: Argument Clinic: fix compiler warnings for getters with docstrings (GH-127310) (#127431)
(cherry picked from commit 99490913a0)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-11-30 23:25:51 +01:00