[New-bugs-announce] [issue35260] 2to3 Parse Error on Python 3 print() with arguments

batterystaple456 report at bugs.python.org
Thu Nov 15 16:09:43 EST 2018


New submission from batterystaple456 <tdddemircan at cvisc.pshs.edu.ph>:

File a.py:

------------------------------------
print("foo", end='bar') # ParseError
------------------------------------

I think the error is caused by arguments in the Python 3 print() function (e.g. end, sep) that are not ignored by 2to3, and (possibly) treated like Python 2 code.

Console stuff:

---------------------------------------------------
$ pip install 2to3
Requirement already satisfied: 2to3 in .\python37\lib\site-packages (1.0)

$ 2to3 .\a.py
...
RefactoringTool: Can't parse .\a.py: ParseError: bad input: type=22, value='=', context=('', (1, 16))
...
---------------------------------------------------

----------
components: 2to3 (2.x to 3.x conversion tool)
messages: 329966
nosy: batterystaple456
priority: normal
severity: normal
status: open
title: 2to3 Parse Error on Python 3 print() with arguments
type: compile error
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35260>
_______________________________________


More information about the New-bugs-announce mailing list