[issue14982] pkgutil.walk_packages seems to not work properly on Python 3.3a

Eric Snow report at bugs.python.org
Sat Jul 7 19:10:54 CEST 2012


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

Importers are a PEP 302 API.  In the context of pkgutil, they are path hooks (see http://www.python.org/dev/peps/pep-0302/#id24), aka path importers.  A path hook is a callable that takes a path and returns a finder.  Path hooks are stored in sys.path_hooks and the finder resulting from a matching path importer is stored in sys.path_importer_cache.

pkgutil also refers to PEP 302 finders as "importers".  To be honest, the import-related nomenclature is a mess.

While you can use pkgutil.ImpImporter as a path hook, instances can also be used as metapath hooks; if you don't pass anything to ImpImporter, the resulting object acts more like a PEP 302 metapath hook that wraps the "default" import process.

(See Lib/pkgutil.py)

----------
nosy: +eric.snow

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14982>
_______________________________________


More information about the Python-bugs-list mailing list