Message162153
| Author |
brett.cannon |
| Recipients |
Arfrever, Marc.Abramowitz, Ronan.Lamy, brett.cannon, eric.smith, pnasrat |
| Date |
2012年06月02日.17:40:11 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1338658812.91.0.873504271911.issue14982@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Basically pkgutil kind of handles importers properly, kind of doesn't. So if a module defined a __loader__ it will use it, but all the rest of its code assumes it uses only the loaders defined in pkgutil.
The problem here is that pkgutil.walk_packages() ends up calling iter_importer_modules() which only returns anything of consequence if the loader has iter_modules() defined which is a non-standard API requirement that only pkgutil loaders has implemented. Basically the docs for pkgutil were incorrect in not specifying that the walk only works for loaders that define iter_modules(). |
|