New submission from bers <b...@gmx.net>:

I did this on Windows 10:

P:\>python --version
Python 3.7.2

P:\>echo print 1, 2 > Test.py

P:\>python Test.py
  File "Test.py", line 1
    print 1, 2
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(1, 2)?

P:\>2to3 -w Test.py
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored Test.py
--- Test.py     (original)
+++ Test.py     (refactored)
@@ -1 +1 @@
-print 1, 2
+print(1, 2)
RefactoringTool: Files that were modified:
RefactoringTool: Test.py

P:\>python Test.py
1 2

P:\>2to3 -w Test.py
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored Test.py
--- Test.py     (original)
+++ Test.py     (refactored)
@@ -1 +1 @@
-print(1, 2)
+print((1, 2))
RefactoringTool: Files that were modified:
RefactoringTool: Test.py

P:\>python Test.py
(1, 2)

Note how "print 1, 2" first becomes "print(1, 2)" (expected), then becomes 
"print((1, 2))" in the following run. This changes the output of Test.py

----------
components: 2to3 (2.x to 3.x conversion tool)
messages: 336653
nosy: bers
priority: normal
severity: normal
status: open
title: Second run of 2to3 continues to modify output
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36122>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to