We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29a5951 commit 19bc144Copy full SHA for 19bc144
1 file changed
Misc/NEWS.d/next/Library/2026-05-12-22-00-00.gh-issue-149728.LzyImp.rst
@@ -0,0 +1,7 @@
1
+Fix a race in :mod:`importlib._bootstrap` where the fast path in
2
+``_find_and_load`` could return a module whose ``parent.child`` attribute had
3
+not yet been set. Under free-threaded CPython this caused packages using the
4
+lazy-submodule ``__getattr__`` pattern (e.g. NumPy) to recurse to
5
+:exc:`RecursionError` when multiple threads first-touched the same lazy
6
+submodule concurrently. ``spec._initializing`` is now kept ``True`` until
7
+after ``_find_and_load_unlocked`` has attached the module to its parent.
0 commit comments