Author ncoghlan
Recipients ncoghlan
Date 2013-12-10.12:29:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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:01ncoghlansetrecipients: + ncoghlan
2013-12-10 12:29:01ncoghlansetmessageid: <>
2013-12-10 12:29:01ncoghlanlinkissue19944 messages
2013-12-10 12:29:01ncoghlancreate