[New-bugs-announce] [issue4671] pydoc executes the code to be documented

Jim_C report at bugs.python.org
Mon Dec 15 22:27:14 CET 2008

New submission from Jim_C <j.conboy at physics.org>:

Running pydoc [ pydoc <modulename> ] on a python module using Tkinter 
displayed the window defined in the module - not what I was 
expecting..   Running pydoc on

from os import remove

will remove the file tmp.tmp, if it exists. 
If this behaviour is intentional ( as it appears to be, see 
imp.load_module ) & presumably integral to the operation of pydoc, then 
it might be worth providing a warning on the web page ( 
http://docs.python.org/library/pydoc.html ) ?? 
Running a code with default arguments in an arbitrary directory could 
potentially produce unwanted side effects, at the very least..
Regards ,

messages: 77881
nosy: Jim_C
severity: normal
status: open
title: pydoc executes the code to be documented
type: behavior
versions: Python 2.4

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list