[issue5524] execfile() removed from Python3

STINNER Victor report at bugs.python.org
Fri Mar 20 09:53:11 CET 2009


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

martin> There is a much simpler solution to the problem: 
martin> use exec(open(fn,"rb").read())

Ok... but there is the newline issue: (self quote) "exec() doesn't support 
newline different than \n, see issue #4628".

And open_python() can be used for other usages than execfile() ;-)

Note: tokenize.open_python() is maybe not the best module and/or function 
name.

----------

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


More information about the Python-bugs-list mailing list