This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mdraw
Recipients CuriousLearner, mdraw, ncoghlan
Date 2017-11-14.17:42:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I think I found a bug in the new print syntax suggestion introduced by

When the following code is executed by Python 3.6.3 inside of a .py file:

    def f():
        print '%d' % 2

, then Python gives the following error message:

    SyntaxError: Missing parentheses in call to 'print'. Did you mean print(int '%d' % 2)?

The "int" next to the left brace of the suggested print function is obviously wrong.
The expected message would be:

    SyntaxError: Missing parentheses in call to 'print'. Did you mean print('%d' % 2)?

Using other values or "%s" in the formatted string in a print statement produces the same wrong message.
This bug only seems to happen when the print statement is inside of a function AND when it is is run inside of a .py file. At least I could not reproduce it in the python3 REPL or outside of a function.

I am attaching the minimal example file in this bug report. Running it with "$ python3" should show the mentioned bug.
Date User Action Args
2017-11-14 17:42:50mdrawsetrecipients: + mdraw, ncoghlan, CuriousLearner
2017-11-14 17:42:50mdrawsetmessageid: <>
2017-11-14 17:42:50mdrawlinkissue32028 messages
2017-11-14 17:42:50mdrawcreate