[issue2029] "python -m pydoc -g" fails

Amaury Forgeot d'Arc report at bugs.python.org
Thu Feb 7 14:21:05 CET 2008


Amaury Forgeot d'Arc added the comment:

There is a difference between "-m" and starting the module directly:
- when running a module, its directory is inserted in front of sys.path.
- with "-m", the empty string '' is inserted in front of sys.path.

The problem with pydoc.py is that there is specific code that modifies
sys.path, and will remove the standard lib from sys.path!
Look for this comment:
   # Scripts don't get the current directory in their path by default.
We could delete three lines there and avoid to remove
dirname(sys.argv[0]) from the path.

----------
nosy: +amaury.forgeotdarc

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2029>
__________________________________


More information about the Python-bugs-list mailing list