[issue3192] exec(open(filename)) doesn't work

Mike Speciner report at bugs.python.org
Tue Jun 24 22:45:47 CEST 2008


New submission from Mike Speciner <speciner_michael at emc.com>:

In 2.5, exec(open(filename)), where filename refers to a file with
python code, executes the code.
In 2.5, open returns an open file, but in 3.0, open returns a stream,
and so exec (which wants "a string, file, or code object, not
TextIOWrapper") returns an error. exec should probably be able to handle
a stream.

----------
components: Interpreter Core
messages: 68700
nosy: ms
severity: normal
status: open
title: exec(open(filename)) doesn't work
type: behavior
versions: Python 3.0

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


More information about the Python-bugs-list mailing list