Commit Graph

122603 Commits

Author SHA1 Message Date
Nadeshiko Manju ae04b6f636
[3.13] gh-120437: Fix `_CHECK_STACK_SPACE` optimization problems introduced in gh-118322 (GH-120712) (#120747)
[3.13] gh-120437: Fix `_CHECK_STACK_SPACE` optimization problems introduced in gh-118322 (GH-120712)

Signed-off-by: Manjusaka <me@manjusaka.me>
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2024-06-20 01:40:48 +08:00
Miss Islington (bot) bb5d19440b
[3.13] gh-120635: Avoid leaking processes in test_pyrepl (GH-120676) (#120741)
gh-120635: Avoid leaking processes in test_pyrepl (GH-120676)

If the child process takes longer than SHORT_TIMEOUT seconds to
complete, kill the process but then wait until it completes with no
timeout to not leak child processes.
(cherry picked from commit 0f3e36454d)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-06-19 13:38:37 +00:00
Miss Islington (bot) 4ce1246a99
[3.13] gh-120722: Set position on RETURN_VALUE in lambda (GH-120724) (#120738)
(cherry picked from commit d8f27cb114)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-06-19 13:22:21 +00:00
Miss Islington (bot) c598e61a22
[3.13] gh-119960: Add information about regex flags in re module functions (GH-119978) (#120730)
gh-119960: Add information about regex flags in re module functions (GH-119978)
(cherry picked from commit a86e6255c3)

Co-authored-by: Awbert <119314310+SweetyAngel@users.noreply.github.com>
2024-06-19 16:00:34 +05:30
Miss Islington (bot) 071b66b218
[3.13] gh-120726: Fix compiler warnings on is_core_module() (GH-120727) (#120729)
gh-120726: Fix compiler warnings on is_core_module() (GH-120727)

Fix compiler warnings on is_core_module() and
check_interpreter_whence(): only define them when
assertions are built.
(cherry picked from commit a816cd67f4)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-06-19 10:23:28 +00:00
Miss Islington (bot) 9be94f9ce6
[3.13] gh-119506: fix `_io.TextIOWrapper.write()` write during flush (GH-119507) (#119964)
gh-119506: fix `_io.TextIOWrapper.write()` write during flush (GH-119507)
(cherry picked from commit 52586f930f)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2024-06-19 10:11:07 +00:00
Miss Islington (bot) d65e145f9d
[3.13] gh-120449: fix ``test_pyclbr`` introspection for mangled names (GH-120450) (GH-120700)
gh-120449: fix ``test_pyclbr`` introspection for mangled names (GH-120450)
(cherry picked from commit d8cd0fa4e3)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-19 09:20:09 +02:00
Miss Islington (bot) 39c3f11f25
[3.13] gh-120381: Fix inspect.ismethoddescriptor() (GH-120684)
The `inspect.ismethoddescriptor()` function did not check for the lack of
`__delete__()` and, consequently, erroneously returned True when applied
to *data* descriptors with only `__get__()` and `__delete__()` defined.

(cherry picked from commit dacc5ac71a)

Co-authored-by: Jan Kaliszewski <zuo@kaliszewski.net>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-06-19 17:01:09 +10:00
Miss Islington (bot) a22eb2f266
[3.13] gh-120633: Move scrollbar and remove tear-off menus in turtledemo (GH-120634) (#120725)
gh-120633: Move scrollbar and remove tear-off menus in turtledemo (GH-120634)
(cherry picked from commit 89f7208f67)

Co-authored-by: Wulian233 <71213467+Wulian233@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-06-19 06:46:13 +00:00
Miss Islington (bot) 1b028117d1
[3.13] gh-120496: Add a note about iterator thread-safe (gh-120685) (#120706)
gh-120496: Add a note about iterator thread-safe (gh-120685)
(cherry picked from commit 7e189aed64)

Co-authored-by: Donghee Na <donghee.na@python.org>
2024-06-19 13:15:44 +09:00
Miss Islington (bot) 50fa775e68
[3.13] gh-120367: fix bug where compiler detects redundant jump after pseudo op replacement (GH-120714) (#120716) 2024-06-18 22:34:07 +00:00
Miss Islington (bot) 07145ddf19
[3.13] gh-117953: Skip `test_interpreters` properly without GIL (gh-120707)
(cherry picked from commit 1035fe0cfb, AKA gh-120689)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-06-18 16:05:30 +00:00
Miss Islington (bot) 1ce5984961
[3.13] gh-118789: Add `PyUnstable_Object_ClearWeakRefsNoCallbacks` (GH-118807) (#120695)
This exposes `PyUnstable_Object_ClearWeakRefsNoCallbacks` as an unstable
C-API function to provide a thread-safe mechanism for clearing weakrefs
without executing callbacks.

Some C-API extensions need to clear weakrefs without calling callbacks,
such as after running finalizers like we do in subtype_dealloc.
Previously they could use `_PyWeakref_ClearRef` on each weakref, but
that's not thread-safe in the free-threaded build.

(cherry picked from commit e8752d7b80)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-06-18 14:54:51 +00:00
Miss Islington (bot) 4f4973d740
[3.13] gh-120659: Skip `test_freethreading` with GIL (GH-120660) (#120694)
gh-120659: Skip `test_freethreading` with GIL (GH-120660)
(cherry picked from commit 360f14a493)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-06-18 14:46:29 +00:00
Miss Islington (bot) 8c129d99ef
[3.13] gh-119241: Add HOWTO for free-threaded C API extensions (GH-119877) (#120693)
Some sections adapted from https://github.com/Quansight-Labs/free-threaded-compatibility/
written by Nathan Goldbaum.

(cherry picked from commit 02b272b702)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
2024-06-18 14:28:51 +00:00
Miss Islington (bot) 36b0052cb2
[3.13] gh-120662: Improve `smtplib` example (GH-120668) (#120681)
gh-120662: Improve `smtplib` example (GH-120668)
(cherry picked from commit 4bc27abdbe)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-18 12:12:58 +00:00
Miss Islington (bot) 692874cdcc
[3.13] gh-119897: Add test for lambda generator invocation (GH-120658) (#120673)
gh-119897: Add test for lambda generator invocation (GH-120658)
(cherry picked from commit 73dc1c678e)


gh-120467: Add test for lambda generator invocation

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-18 10:16:42 +00:00
Miss Islington (bot) 451cb71cc8
[3.13] gh-120590: Fix test_pydoc in the refleak hunting mode (GH-120615) (GH-120669)
Mocking only works if sys.modules['pydoc'] and pydoc are the same,
but some pydoc functions reload the module and change sys.modules.
Ensure that sys.modules['pydoc'] is always restored after the corresponding
tests.
(cherry picked from commit 2cf47389e2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-18 09:54:55 +00:00
Miss Islington (bot) 71ad34d219
[3.13] gh-120524: Avoid a Race On _PyRuntime.types.managed_static.types[i].interp_count (gh-120657)
gh-120182 added new global state (interp_count), but didn't add thread-safety for it.  This change eliminates the possible race.

(cherry picked from commit 2c66318cdc, AKA gh-120529)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-06-17 16:13:40 -06:00
Miss Islington (bot) 396f8b0b98
[3.13] gh-117657: Fix `__slots__` thread safety in free-threaded build (GH-119368) (#120655)
Fix a race in `PyMember_GetOne` and `PyMember_SetOne` for `Py_T_OBJECT_EX`.
These functions implement `__slots__` accesses for Python objects.
(cherry picked from commit 362cd2680b)

Co-authored-by: Daniele Parmeggiani <8658291+dpdani@users.noreply.github.com>
2024-06-17 19:12:25 +00:00
Miss Islington (bot) 0dbb86c5be
[3.13] gh-117657: Fix TSan reported data race on ioctl_works (GH-120175) (#120654)
(cherry picked from commit 460cc9e14e)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-06-17 17:52:49 +00:00
Miss Islington (bot) 9172bc35c6
[3.13] gh-115649: Copy the filename into main interpreter before intern in import.c (GH-120315) (#120652)
gh-115649: Copy the filename into main interpreter before intern in import.c (GH-120315)
(cherry picked from commit 28140d1f2d)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-06-17 22:30:26 +05:30
Miss Islington (bot) f7ba3233a2
[3.13] gh-120433: Mention ``chocolatey`` for installing llvm on Windows as an alternative option (GH-120434) (#120651)
gh-120433: Mention ``chocolatey`` for installing llvm on Windows as an alternative option (GH-120434)
(cherry picked from commit 95737bbf18)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-06-17 19:18:07 +03:00
Miss Islington (bot) 61a2229005
[3.13] gh-120367: fix removal of redundant NOPs and jumps after reordering hot-cold blocks (GH-120425) (#120621)
gh-120367: fix removal of redundant NOPs and jumps after reordering hot-cold blocks (GH-120425)
(cherry picked from commit 21866c8ed2)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-17 16:07:20 +01:00
Jelle Zijlstra 7c47f93dff
[3.13] gh-119933: Improve ``SyntaxError`` message for invalid type parameters expressions (GH-119976) (#120641)
(cherry picked from commit 4bf17c381f)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-17 08:01:49 -07:00
Miss Islington (bot) 03b89e3a3d
[3.13] gh-120586: Fix several "unused function" warnings in `posixmodule.c` (GH-120588) (#120616)
gh-120586: Fix several "unused function" warnings in `posixmodule.c` (GH-120588)
(cherry picked from commit 3df2022931)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-17 07:09:11 +00:00
Miss Islington (bot) 3b28e430ed
[3.13] gh-112346: Document the OS byte in `gzip.compress` output change in 3.11 (GH-120480) (#120612)
gh-112346: Document the OS byte in `gzip.compress` output change in 3.11 (GH-120480)
(cherry picked from commit bac4edad69)


gh-112346: Describe the "os" byte in gzip output change.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-06-17 06:06:11 +00:00
Miss Islington (bot) aa39ba0af3
[3.13] gh-120567: Clarify weekday return in calendar.monthrange docstring (GH-120570) (#120597)
gh-120567: Clarify weekday return in calendar.monthrange docstring (GH-120570)
(cherry picked from commit bd4516d9ef)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-16 21:09:54 +00:00
Miss Islington (bot) 7655989a3a
[3.13] gh-118596: Add thread-safety clarifications to the SSLContext documentation (GH-118597) (#120595)
gh-118596: Add thread-safety clarifications to the SSLContext documentation (GH-118597)

Add thread-safety clarifications to the SSLContext documentation. Per the issue:

This issue has also come up [here](https://github.com/psf/requests/pull/6667) where the matter was clarified by @tiran in [this comment](https://github.com/psf/requests/pull/6667):
> `SSLContext` is designed to be shared and used for multiple connections. It is thread safe as long as you don't reconfigure it once it is used by a connection. Adding new certs to the internal trust store is fine, but changing ciphers, verification settings, or mTLS certs can lead to surprising behavior. The problem is unrelated to threads and can even occur in a single-threaded program.
(cherry picked from commit 4f59f86382)

Co-authored-by: mm-matthias <43849132+mm-matthias@users.noreply.github.com>
2024-06-16 20:43:20 +00:00
Tian Gao 1c41aa78d8
[3.13] gh-119824: Print stack entry when user input is needed (GH-119882) (#120533)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-16 12:05:07 -07:00
Miss Islington (bot) 6ee68fbf9b
[3.13] gh-120584: Fix "unused thread_critical_sections" warning in `test_critical_sections` (GH-120585) (#120592)
gh-120584: Fix "unused thread_critical_sections" warning in `test_critical_sections` (GH-120585)
(cherry picked from commit b337aefd3e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-16 17:38:00 +00:00
Miss Islington (bot) 96b784b61f
[3.13] Docs: remove temporary hardcoded links (GH-120348) (#120587)
Docs: remove temporary hardcoded links (GH-120348)
(cherry picked from commit b8484c6ad7)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-16 13:07:27 +00:00
Miss Islington (bot) f2a4540c4f
[3.13] gh-120579: Guard `_testcapi` import in `test_free_threading` (GH-120580) (#120583)
gh-120579: Guard `_testcapi` import in `test_free_threading` (GH-120580)
(cherry picked from commit 0c0348adbf)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-16 08:50:33 +00:00
Miss Islington (bot) eee2c45633
[3.13] gh-120360: Add self as IDLE doc owner (GH-120571) (#120576)
gh-120360: Add self as IDLE doc owner (GH-120571)

Add self as IDLE doc owner
(cherry picked from commit cf49ef78f8)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-06-16 06:22:07 +00:00
Miss Islington (bot) d4e1d093d8
[3.13] gh-120572: add missing parentheses in TypeIs documentation (GH-120573) (#120575)
gh-120572: add missing parentheses in TypeIs documentation (GH-120573)
(cherry picked from commit 1fa595963e)

Co-authored-by: Nyuan Zhang <blueglassblock@outlook.com>
2024-06-16 05:51:29 +00:00
Miss Islington (bot) a19bb261a3
[3.13] gh-112346: Always set OS byte to 255, simpler gzip.compress function. (GH-120486) (#120563)
gh-112346: Always set OS byte to 255, simpler gzip.compress function. (GH-120486)

This matches the output behavior in 3.10 and earlier; the optimization in 3.11 allowed the zlib library's "os" value to be filled in instead in the circumstance when mtime was 0.  this keeps things consistent.
(cherry picked from commit 08d09cf5ba)

Co-authored-by: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
2024-06-15 19:10:50 +00:00
Miss Islington (bot) 3a9f438c92
[3.13] gh-120541: Improve the "less" prompt in pydoc (GH-120543) (GH-120562)
When help() is called with non-string argument, use __qualname__ or
__name__ if available, otherwise use "{typename} object".
(cherry picked from commit 31d1d72d7e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-15 18:21:13 +00:00
Miss Islington (bot) 29bbd5f8e4
[3.13] annotations: expand documentation on "simple" assignment targets (GH-120535) (#120555)
This behavior is rather surprising and it was not clearly specified.

(cherry picked from commit 9e0b11eb21)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-15 15:35:57 +00:00
Miss Islington (bot) cbcb5265bf
[3.13] gh-117657: Make PyType_HasFeature (exported version) atomic (GH-120484) (#120554)
gh-117657: Make PyType_HasFeature (exported version) atomic (GH-120484)

Make PyType_HasFeature (exported version) atomic
(cherry picked from commit 6f63dfff6f)

Co-authored-by: Ken Jin <kenjin@python.org>
2024-06-15 15:06:54 +00:00
Miss Islington (bot) 13a5082afe
[3.13] Add some more edge-case tests for `inspect.get_annotations` with `eval_str=True` (GH-120550) (#120551)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-15 13:16:40 +00:00
Miss Islington (bot) 767c955544
[3.13] gh-120544: Add `else: fail()` to tests where exception is expected (GH-120545) (#120546)
gh-120544: Add `else: fail()` to tests where exception is expected (GH-120545)
(cherry picked from commit 42ebdd83bb)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-15 12:54:07 +01:00
Miss Islington (bot) e54a28bcc9
[3.13] gh-120495: Fix incorrect exception handling in Tab Nanny (GH-120498) (#120548)
gh-120495: Fix incorrect exception handling in Tab Nanny (GH-120498)
(cherry picked from commit c501261c91)

Co-authored-by: Wulian233 <71213467+Wulian233@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-15 11:28:28 +00:00
Miss Islington (bot) 9f0269d6ae
[3.13] gh-120526: Correct signature of map() builtin (GH-120528) (GH-120539)
map() requires at least one iterable arg.

(cherry picked from commit d4039d3f6f)

Signed-off-by: Adam Williamson <awilliam@redhat.com>
Co-authored-by: Adam Williamson <adam@blueradius.ca>
2024-06-15 05:59:37 +00:00
Miss Islington (bot) 3c88898a69
[3.13] gh-119819: Conditional skip of logging tests that require multiprocessing subprocess support (GH-120476) (#120531)
gh-119819: Conditional skip of logging tests that require multiprocessing subprocess support (GH-120476)

Skip tests that require multiprocessing subprocess support.
(cherry picked from commit 92f6d400f7)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2024-06-15 08:32:22 +08:00
Eric Snow f021f9e50e
[3.13] gh-120524: Temporarily Skip test_create_many_threaded In test_interpreters.test_stress (gh-120527) 2024-06-14 22:14:29 +00:00
Miss Islington (bot) 18ea22a830
[3.13] gh-120161: Fix a Crash in the _datetime Module (gh-120518)
In gh-120009 I used an atexit hook to finalize the _datetime module's static types at interpreter shutdown.  However, atexit hooks are executed very early in finalization, which is a problem in the few cases where a subclass of one of those static types is still alive until the final GC collection.  The static builtin types don't have this probably because they are finalized toward the end, after the final GC collection.  To avoid the problem for _datetime, I have applied a similar approach here.

Also, credit goes to @mgorny and @neonene for the new tests.

FYI, I would have liked to take a slightly cleaner approach with managed static types, but wanted to get a smaller fix in first for the sake of backporting.  I'll circle back to the cleaner approach with a future change on the main branch.

(cherry picked from commit b2e71ff4f8, AKA gh-120182)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-06-14 19:54:46 +00:00
Miss Islington (bot) da40fa3526
[3.13] gh-120361: Add `nonmember` test with enum flags inside to `test_enum` (GH-120364) (#120511)
gh-120361: Add `nonmember` test with enum flags inside to `test_enum` (GH-120364)

* gh-120361: Add `nonmember` test with enum flags inside to `test_enum`
(cherry picked from commit 7fadfd82eb)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-14 22:08:21 +03:00
Miss Islington (bot) 6e3e112428
[3.13] gh-117657: Add TSAN suppression for set_default_allocator_unlocked (GH-120500) (#120510)
gh-117657: Add TSAN suppression for set_default_allocator_unlocked (GH-120500)

Add TSAN suppression for set_default_allocator_unlocked
(cherry picked from commit 2bacc2343c)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2024-06-14 16:34:07 +00:00
Miss Islington (bot) d73f856840
[3.13] gh-120400 :Support Linux perf profile to see Python calls on RISC-V architecture (GH-120089) (#120413)
gh-120400 :Support Linux perf profile to see Python calls on RISC-V architecture (GH-120089)
(cherry picked from commit 4b1e85bafc)

Co-authored-by: ixgbe00 <yangwang@iscas.ac.cn>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2024-06-14 17:03:24 +02:00
Miss Islington (bot) d4174fa7ca
[3.13] gh-114053: Fix bad interaction of PEP 695, PEP 563 and `inspect.get_annotations` (GH-120270) (#120474)
gh-114053: Fix bad interaction of PEP 695, PEP 563 and `inspect.get_annotations` (GH-120270)
(cherry picked from commit 42351c3b9a)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-13 21:41:14 +00:00