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 ncoghlan
Recipients ncoghlan
Date 2017-06-08.10:36:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Back when we added the custom error message for missing parentheses in print calls, I also pre-seeded an explanation of the error on Stack Overflow:

While that does seem to be having the desired effect of explaining an otherwise cryptic message to people, William Brown pointed out that it could potentially be improved by taking advantage of the fact we have access to the rest of the line when working out the exact error text:

>>> print "Hello world!"
  File "<stdin>", line 1
    print "Hello world!"
SyntaxError: Missing parentheses in call to 'print'. Did you mean 'print("Hello world!")'?

The rationale for such a change is similar to the rationale for adding the custom error message in the first place: the folks most likely to hit this are either attempting to run a Python 2 script on Py3, or else attempting to follow a Py2 tutorial on Py3, and *telling* them what's wrong isn't as clear as *showing* them (by reprinting the line with the parentheses added)
Date User Action Args
2017-06-08 10:36:46ncoghlansetrecipients: + ncoghlan
2017-06-08 10:36:46ncoghlansetmessageid: <>
2017-06-08 10:36:46ncoghlanlinkissue30597 messages
2017-06-08 10:36:45ncoghlancreate