[issue45591] PathFinder does not find namespace packages children

Brett Cannon report at bugs.python.org
Tue Oct 26 12:43:01 EDT 2021


Brett Cannon <brett at python.org> added the comment:

> I am curious, what is `fullname` supposed to mean then? "full" in what sense?

You can still specify the full name of the module you're trying to import, but you also need to pass in the location information for that module. So the code does `fullname.rpartition(".")[-1]` to get the name of the module that you're looking for. So `PathFinder.find_spec('namespace.a', path=spec.submodule_search_locations)` should also work.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45591>
_______________________________________


More information about the Python-bugs-list mailing list