[issue12902] help("modules") executes module code

Éric Araujo report at bugs.python.org
Tue Sep 6 17:35:38 CEST 2011


Éric Araujo <merwok at netwok.org> added the comment:

Thanks for the report.  This comes from the fact that pydoc imports the modules in order to get their documentation.  Your message makes me think that the KWallet Python modules have a problem: they should not pop GUIs at import time!  Please report this to them.

In the Python docs, there is a note warning about this: http://docs.python.org/dev/library/pydoc .  The doc for help, which is not on the same page, does not: http://docs.python.org/dev/library/functions#help

It could be possible to load the code of a module without executing it.  I’m not sure it would be a good idea; maybe you could ask for opinions on the python-ideas mailing list?

----------
components:  -None
nosy: +eric.araujo
versions:  -Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12902>
_______________________________________


More information about the Python-bugs-list mailing list