[issue4717] execfile conversion is not correct

2008-12-22 Thread Fabio Zadrozny

New submission from Fabio Zadrozny fab...@users.sourceforge.net:

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.

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 78170
nosy: fabioz
severity: normal
status: open
title: execfile conversion is not correct
versions: Python 3.0

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4717] execfile conversion is not correct

2008-12-22 Thread Benjamin Peterson

Benjamin Peterson musiccomposit...@gmail.com added the comment:

Fixed in r67900.

--
nosy: +benjamin.peterson
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com