[issue13332] execfile fixer produces code that does not close the file

2021-10-20 Thread Irit Katriel
Change by Irit Katriel : -- resolution: duplicate -> wont fix ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13332] execfile fixer produces code that does not close the file

2021-10-20 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Close 2to3 issues and list them here ___ Python tracker ___

[issue13332] execfile fixer produces code that does not close the file

2011-11-03 Thread Sven Marnach
New submission from Sven Marnach s...@marnach.net: The execfile fixer of the 2to3 script replaces the 2.x code execfile(a.py) by exec(compile(open(a.py).read(), a.py, 'exec')) The new code does not explicitly close the file. This is not usually a problem in CPython, but 1. the

[issue13332] execfile fixer produces code that does not close the file

2011-11-03 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Sounds reasonable to me. Is it easy to generate unique identifier names in 2to3 fixers? -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13332

[issue13332] execfile fixer produces code that does not close the file

2011-11-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Be aware that execfile() is a simple function call and can be used in any expression. -- nosy: +benjamin.peterson, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13332

[issue13332] execfile fixer produces code that does not close the file

2011-11-03 Thread Sven Marnach
Sven Marnach s...@marnach.net added the comment: @Petri: Yes, that's what the BaseFix.new_name() method is for. @Antoine: I thought about this, though I don't think it is very common to call execfile() as part of an expression. The whole statement containing the function call would need to be

[issue13332] execfile fixer produces code that does not close the file

2011-11-03 Thread Sven Marnach
Sven Marnach s...@marnach.net added the comment: Getting the general case right seems a bit too difficult. Examples like [execfile(n) for n in names if condition(n)] execfile(execfile(n1) or n2) try: 1 / 0 except execfile(n) or ZeroDivisionError: pass would require rather

[issue13332] execfile fixer produces code that does not close the file

2011-11-03 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Or you could just explicitly write out the exec(compile()) in your 2.x code. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13332

[issue13332] execfile fixer produces code that does not close the file

2011-11-03 Thread Vlada Peric
Changes by Vlada Peric vlada.pe...@gmail.com: -- nosy: +VPeric ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13332 ___ ___ Python-bugs-list

[issue13332] execfile fixer produces code that does not close the file

2011-11-03 Thread Aaron Meurer
Changes by Aaron Meurer asmeu...@gmail.com: -- nosy: +Aaron.Meurer ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13332 ___ ___ Python-bugs-list