Message160464
pkgutil.walk_packages(paths) seems to return incorrect results when the name of a subpackage of a path in paths matches the name of a package in the standard library. It both excludes modules it should include, and includes modules it should exclude. Here is an example:
> mkdir temp
> touch temp/__init__.py
> touch temp/foo.py
> mkdir temp/logging
> touch temp/logging/__init__.py
> touch temp/logging/bar.py
> python
Python 3.2.3 (default, Apr 29 2012, 01:19:06)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pkgutil import walk_packages
>>> for info in walk_packages(['temp']):
... print(info[1], info[0].path)
...
foo temp
logging temp
logging.config /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/logging
logging.handlers /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/logging
>>>
Observe that logging.bar is absent from the list, and logging.config and logging.handlers are included. |
|
Date |
User |
Action |
Args |
2012-05-12 09:01:11 | chris.jerdonek | set | recipients:
+ chris.jerdonek |
2012-05-12 09:01:11 | chris.jerdonek | set | messageid: <1336813271.29.0.464157696844.issue14787@psf.upfronthosting.co.za> |
2012-05-12 09:01:10 | chris.jerdonek | link | issue14787 messages |
2012-05-12 09:01:10 | chris.jerdonek | create | |
|