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 mbussonn
Recipients Anthony Sottile, BTaskaya, gvanrossum, hauntsaninja, lys.nikolaou, mbussonn, ned.deily, pablogsal, serhiy.storchaka
Date 2020-05-10.23:44:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Seem to not be in the new parser but simply in codeop in particular `def _maybe_compile`

The logic seem weird (but weird logic usually have a reason), it try to compile thrice by appending many `\n`.

1) Why do that and not return the first successful compile directly ? I'm not sure. 
2) It does compare the repr of error when  compile(source + "\n") and compile(source+'\n\n') and only raise if both are identical (which they are not in the new parser, they differ by `\n`...)

SyntaxError('invalid syntax', ('<input>', 1, 6, 'def a-b')) 
SyntaxError('invalid syntax', ('<input>', 1, 6, 'def a-b\n'))

This logic seem to go back to the 2000s.
Date User Action Args
2020-05-10 23:44:03mbussonnsetrecipients: + mbussonn, gvanrossum, ned.deily, serhiy.storchaka, Anthony Sottile, lys.nikolaou, pablogsal, BTaskaya, hauntsaninja
2020-05-10 23:44:03mbussonnsetmessageid: <>
2020-05-10 23:44:03mbussonnlinkissue40334 messages
2020-05-10 23:44:02mbussonncreate