[New-bugs-announce] [issue6148] Help well execute code it is called on
report at bugs.python.org
Sat May 30 08:37:21 CEST 2009
New submission from Ian Miers <imichaelmiers at gmail.com>:
when calling help() from the python interpreter on a function
whose default argument is provided by another function
( e.g. def foo(bar=baz() ) : .... ), help will call baz().
This can cause problems because baz() can alter statefull
data like a file or database entry.
This is both a bug in that it does this and in that
To see this download the attached file and then :
Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import bug
at this point the file bug now has been written to disk.
This is a problem
I've got to think there is a reason for this, but seeing as I cant
come up with it , better safe than sorry.
components: Documentation, Interpreter Core
nosy: georg.brandl, imiers1
title: Help well execute code it is called on
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file14120/bug.py
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce