cpython/Lib/importlib
Gregory P. Smith 9a57179d74
GH-83065: Fix import deadlock by implementing hierarchical module locking (GH-137196)
Make _find_and_load() acquire the module locks for the full
dotted-name chain (parent before child) when loading a nested module, so
both threads contend on the same first lock and serialise instead of
deadlocking.

When acquiring a parent's lock would itself deadlock with another thread
that is loading that parent (cross-package circular imports), the parent's
lock is skipped and the partially-initialised parent is accepted -- the
same policy _lock_unlock_module() already applies on the existing code
path -- so concurrent circular imports that worked before continue to work.
2026-04-28 01:06:23 -07:00
..
metadata gh-143387: Raise an exception instead of returning None when metadata file is missing. (#146234) 2026-03-23 09:12:36 -04:00
resources gh-121190: Emit a better error message from importlib.resources.files() when module spec is None" (#148460) 2026-04-12 18:15:01 -04:00
__init__.py GH-139686: Revert "gh-139686: Make reloading a lazy module no-op (GH-139857)" (#143584) 2026-01-08 22:08:03 +00:00
_abc.py GH-97850: Remove all uses and definitions of load_module() from importlib (#142205) 2025-12-10 15:35:51 -08:00
_bootstrap.py GH-83065: Fix import deadlock by implementing hierarchical module locking (GH-137196) 2026-04-28 01:06:23 -07:00
_bootstrap_external.py gh-145506: Fixes CVE-2026-2297 by ensuring SourcelessFileLoader uses io.open_code (GH-145507) 2026-03-04 19:55:52 +00:00
abc.py gh-139899: Introduce MetaPathFinder.discover and PathEntryFinder.discover (#139900) 2026-02-19 15:25:50 +00:00
machinery.py GH-119668: expose importlib.machinery.NamespacePath (#119669) 2025-11-01 00:39:48 +00:00
readers.py bpo-46118: Move importlib.resources to its own package. (#30176) 2021-12-30 21:00:48 -05:00
simple.py bpo-46118: Move importlib.resources to its own package. (#30176) 2021-12-30 21:00:48 -05:00
util.py gh-122188: Move magic number to its own file (#122243) 2024-07-30 15:31:05 -04:00