Author fabioz
Recipients fabioz
Date 2008-12-22.11:24:57
SpamBayes Score 0.179946
Marked as misclassified No
Message-id <>
In 2to3, execfile(file, globals, locals) is translated to 

exec(open(file).read(), globals, locals)

But that's not correct, as the actual file from the executed code gets
wrong with that.

The correct thing would be:

exec(compile(open(file).read(), file, 'exec'), globals, locals)

So that the name of the file remains correct in the module that's being run.
Date User Action Args
2008-12-22 11:24:58fabiozsetrecipients: + fabioz
2008-12-22 11:24:58fabiozsetmessageid: <>
2008-12-22 11:24:57fabiozlinkissue4717 messages
2008-12-22 11:24:57fabiozcreate