This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.snow
Recipients brett.cannon, eric.snow, ncoghlan
Date 2014-04-14.01:48:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1397440098.66.0.10150246835.issue21211@psf.upfronthosting.co.za>
In-reply-to
Content
In 3987667bf98f pkgutil.find_loader() switched from using pkgutil.iter_importers() to importlib.find_module().  importlib.find_module() checks the module's __loader__ (and raises ImportError when invalid) whereas iter_importers() does no such check.  In 3.4 pkgutil.find_loader() switched over to importlib.util.find_spec(), but the same issue remains.

The documentation (and the previous behavior) implies that the ImportError case coming out of find_spec() should result in pkgutil.find_loader() returning None rather than propagating the ImportError.  However, it may make more sense to do an explicit check for module.__spec__ before calling find_spec().
History
Date User Action Args
2014-04-14 01:48:18eric.snowsetrecipients: + eric.snow, brett.cannon, ncoghlan
2014-04-14 01:48:18eric.snowsetmessageid: <1397440098.66.0.10150246835.issue21211@psf.upfronthosting.co.za>
2014-04-14 01:48:18eric.snowlinkissue21211 messages
2014-04-14 01:48:17eric.snowcreate