Message205804
In implementing the runpy module updates for PEP 451 I ran into the fact that importlib.find_spec had copied the find_loader behaviour where it doesn't handle dotted names automatically - you have to explicitly pass in the __path__ from the parent module for it to work.
For find_loader, runpy used pkgutil.get_loader instead. The patch on issue 19700 currently includes a runpy._fixed_find_spec function that handles walking the module name components, loading packages as necessary.
I believe it would be better to move the current thin wrapper around importlib._bootstrap._find_spec to importlib.find_spec_on_path (which will only search for the specified module name directly on the given path without breaking it up into components), with find_spec itself changed to *not* take a "path" argument, and instead always doing the full lookup (as implemented in the issue 19700 patch _fixed_find_spec function) |
|
Date |
User |
Action |
Args |
2013-12-10 12:29:01 | ncoghlan | set | recipients:
+ ncoghlan |
2013-12-10 12:29:01 | ncoghlan | set | messageid: <1386678541.87.0.362363609573.issue19944@psf.upfronthosting.co.za> |
2013-12-10 12:29:01 | ncoghlan | link | issue19944 messages |
2013-12-10 12:29:01 | ncoghlan | create | |
|