Message367856
Ah, namespace packages. :) Yeah, the code is not taking the "spec.loader is None" case into account. I expect the fix would be to add handling of that case a few lines up in the code, right after handling BuiltinImporter and FrozenImporter. Offhand I'm not sure if the "type" should be _PKG_DIRECTORY or some new one just for namespace packages. How does imp.find_module() (on which modulefinder._find_module() is based) respond to namespace packages?
[1] https://docs.python.org/3/library/importlib.html#importlib.machinery.ModuleSpec.loader |
|
Date |
User |
Action |
Args |
2020-05-01 15:40:47 | eric.snow | set | recipients:
+ eric.snow, barry, brett.cannon, eric.smith, Greg Whiteley |
2020-05-01 15:40:46 | eric.snow | set | messageid: <1588347646.99.0.153092901688.issue40350@roundup.psfhosted.org> |
2020-05-01 15:40:46 | eric.snow | link | issue40350 messages |
2020-05-01 15:40:46 | eric.snow | create | |
|