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 chris.jerdonek
Recipients Arfrever, Marc.Abramowitz, Ronan.Lamy, brett.cannon, chris.jerdonek, eric.smith, pnasrat, python-dev
Date 2012-07-07.15:45:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1341675906.32.0.142440683476.issue14982@psf.upfronthosting.co.za>
In-reply-to
Content
As someone who isn't an expert on Python's import mechanisms, I'm confused by this comment at the end of pkgutil.walk_packages():

"Note: Only works for importers which define a iter_modules() method, which is non-standard but implemented by classes defined in this module."

I'm confused because importers aren't mentioned anywhere in the context of walk_packages() (in particular, `importer` is not a parameter to the function), so it's not clear to me how the note comes into play.

For example, is "importers" in reference to the import statements inside the modules in the package that one is trying to walk, or is it a reference to whether or not the user has overridden Python's standard import with a custom import function?

In particular, does this mean that the normal case of trying to walk a directory using `pkgutil.walk_packages(['my_dir'])` won't work without doing something special, and if so, can that special thing be added?

I think it would help if this were made clearer.  I came to this after trying to start working on issue 14787.
History
Date User Action Args
2012-07-07 15:45:06chris.jerdoneksetrecipients: + chris.jerdonek, brett.cannon, eric.smith, Arfrever, pnasrat, python-dev, Marc.Abramowitz, Ronan.Lamy
2012-07-07 15:45:06chris.jerdoneksetmessageid: <1341675906.32.0.142440683476.issue14982@psf.upfronthosting.co.za>
2012-07-07 15:45:05chris.jerdoneklinkissue14982 messages
2012-07-07 15:45:05chris.jerdonekcreate