Miss Islington (bot) and Cary Hawkins
e60e7bdc92
[3.15] gh-159652: Fix import lock leak when the C stack is nearly exhausted (GH-159660) (GH-160779)
...
gh-159652: Fix import lock leak when the C stack is nearly exhausted (GH-159660)
When an import failed with a stack overflow RecursionError, releasing the import locks on the error path could itself raise RecursionError, because the cleanup runs in a new C frame. This left the global import lock or a module lock held forever, and later imports in other threads blocked indefinitely.
_imp.acquire_lock() now raises RecursionError when there is not enough stack left to release the lock. importlib calls it before taking any import lock, so this covers the per-module locks too. The module lock weakref callback skips cleanup in that case instead of
reporting an unraisable exception.
(cherry picked from commit 926b0bf311 )
Co-authored-by: Cary Hawkins <hawkinscary23@gmail.com >
2026-10-27 22:17:27 +00:00
..
2026-10-01 16:56:39 +00:00
2022-10-17 12:01:00 +02:00
2026-03-24 17:47:55 +00:00
2026-10-21 11:55:12 -07:00
2021-03-23 20:47:40 +01:00
2026-05-12 22:10:24 +02:00
2026-10-23 21:01:06 +00:00
2026-06-09 20:16:42 +00:00
2026-09-24 23:51:39 +01:00
2026-03-09 10:37:23 -07:00
2026-09-24 23:51:39 +01:00
2026-07-10 02:07:38 +00:00
2025-03-17 09:19:04 +00:00
2026-09-29 10:13:34 +03:00
2026-10-22 06:23:06 -07:00
2026-03-02 11:47:32 +01:00
2026-08-26 14:52:45 +09:00
2026-10-22 21:38:32 +01:00
2026-04-22 09:08:23 +01:00
2026-10-22 15:26:02 -07:00
2026-10-13 11:51:33 +02:00
2026-10-10 13:58:08 +03:00
2024-02-02 13:50:51 +00:00
2024-04-02 20:35:52 +00:00
2026-10-22 15:22:23 -07:00
2026-06-19 09:52:07 -04:00
2026-04-01 18:34:55 +02:00
2025-06-13 16:45:21 -06:00
2026-10-22 21:38:32 +01:00
2026-09-30 11:18:45 +03:00
2023-09-02 16:50:18 +02:00
2017-12-12 13:55:04 +02:00
2023-10-04 22:50:29 +00:00
2026-07-29 10:21:30 +02:00
2023-10-04 22:50:29 +00:00
2026-05-04 17:45:08 +01:00
2023-09-08 17:54:45 +01:00
2025-07-22 15:05:26 +02:00
2025-09-17 15:33:55 +01:00
2026-02-26 06:21:05 +08:00
2026-10-11 07:20:28 +00:00
2026-10-22 06:23:06 -07:00
2026-10-10 22:08:49 +02:00
2026-10-19 08:43:26 +00:00
2026-02-06 09:43:36 -05:00
2026-08-27 13:51:03 +03:00
2025-08-06 14:33:28 +02:00
2024-10-29 23:57:59 +00:00
2026-10-22 09:55:05 -07:00
2024-07-22 12:08:27 -04:00
2026-10-11 15:42:59 +01:00
2026-10-22 06:23:06 -07:00
2026-03-31 10:59:17 +03:00
2025-11-10 15:50:51 +01:00
2024-11-12 15:59:19 +02:00
2025-05-05 15:09:19 +00:00
2017-11-28 17:56:10 +02:00
2025-06-16 23:32:52 +09:00
2026-08-17 03:58:10 +00:00
2023-12-06 15:09:22 +01:00
2026-10-27 22:17:27 +00:00
2025-11-26 14:12:49 +01:00
2025-05-25 20:19:29 +00:00
2026-10-20 00:18:08 +00:00
2026-01-16 09:11:58 +00:00
2026-10-19 19:47:56 +00:00
2026-10-20 11:12:17 -07:00
2025-10-11 22:58:14 +02:00
2026-05-05 09:29:07 +01:00
2026-05-12 22:10:24 +02:00
2026-05-05 15:19:16 +01:00
2026-04-10 17:58:17 +05:30
2026-10-19 14:54:15 -07:00
2026-10-22 09:55:05 -07:00
2026-04-02 13:54:21 +02:00
2022-10-07 11:49:53 -07:00
2023-09-03 18:54:27 +02:00
2024-07-22 12:08:27 -04:00
2026-05-05 15:19:16 +01:00
2026-05-11 14:23:39 -04:00
2026-10-12 16:31:15 +02:00
2026-10-12 16:31:15 +02:00
2026-10-12 16:31:15 +02:00
2026-08-03 16:23:34 +01:00
2026-04-22 14:31:19 -04:00
2025-05-09 11:39:23 +00:00
2026-09-18 21:37:15 +00:00
2026-09-18 21:37:15 +00:00
2026-04-11 21:54:23 +00:00
2024-11-07 16:37:41 +01:00
2022-01-13 09:46:04 +01:00
2026-02-21 12:42:13 +01:00
2026-10-26 19:49:41 +00:00
2021-10-15 19:45:34 +02:00
2026-10-22 09:55:05 -07:00
2026-04-24 10:37:01 +01:00
2023-09-01 18:36:53 +02:00
2026-05-13 23:29:08 +02:00
2026-09-30 11:18:45 +03:00
2026-10-12 14:08:25 +02:00
2026-03-24 17:47:55 +00:00
2026-07-10 02:07:38 +00:00
2026-07-06 15:25:47 +00:00
2026-02-17 11:12:25 -05:00
2014-07-25 21:52:14 +10:00
2026-05-05 15:19:16 +01:00
2026-10-11 15:42:59 +01:00
2025-12-06 22:37:34 +00:00
2026-05-05 09:18:04 +02:00
2026-05-05 09:18:04 +02:00
2026-05-05 09:18:04 +02:00
2026-10-10 16:03:02 +05:30
2025-11-05 11:12:56 -08:00
2025-10-31 16:13:43 +02:00
2026-05-06 09:50:24 -04:00
2025-03-17 09:19:04 +00:00
2026-10-23 10:41:48 -07:00
2026-09-23 01:11:38 +01:00
2026-07-24 23:01:47 +00:00
2024-10-13 20:59:41 +05:30
2026-10-12 23:32:24 +00:00
2025-11-06 16:10:39 +01:00
2024-03-13 23:53:32 +01:00
2026-10-09 20:54:35 +03:00
2026-08-31 09:53:56 +03:00
2025-01-17 16:42:27 +01:00
2025-04-29 12:56:20 +02:00