[issue5230] pydoc reports misleading failure if target module raises an ImportError
Jean-Paul Calderone
report at bugs.python.org
Thu Feb 12 22:16:28 CET 2009
New submission from Jean-Paul Calderone <exarkun at divmod.com>:
If pydoc is used to try to look up the documentation for a module which
does not exist, this is reported reasonably:
exarkun at charm:~$ pydoc foobarbaz
no Python documentation found for 'foobarbaz'
exarkun at charm:~$
However, if it is used to look up the documentation for a module which
does exist but which itself imports a module which does not exist, then
the same report is made:
exarkun at charm:~$ cat > foobarbaz.py
import barbazquux
exarkun at charm:~$ pydoc foobarbaz
no Python documentation found for 'foobarbaz'
exarkun at charm:~$
This is somewhat misleading, since it suggests that there is no such
module "foobarbaz", when the problem is solved by installing the module
"barbazquux":
exarkun at charm:~$ touch barbazquux.py
exarkun at charm:~$ pydoc foobarbaz
Help on module foobarbaz:
...
exarkun at charm:~$
I'm sure the cause of this is the incautious handling of ImportError by
pydoc, resulting in the mistaken identification of the problem.
----------
messages: 81821
nosy: exarkun
severity: normal
status: open
title: pydoc reports misleading failure if target module raises an ImportError
type: behavior
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5230>
_______________________________________
More information about the Python-bugs-list
mailing list