PathFinder.find_spec() can raise bare KeyError when path=None
#93334
Labels
PathFinder.find_spec() can raise bare KeyError when path=None
#93334
Bug report
For the following tree, where
./bis not a package,PathFinder.find_spec("a.b")raises an undocumentedKeyError:Works as expected if
ais provided as thepathargument:Your environment
Python 3.10.2 (v3.10.2:a58ebcc701, Jan 13 2022, 14:50:16) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Also reproduced on 3.8 and 3.12.0a0
The text was updated successfully, but these errors were encountered: