main
main copied to clipboard
exec("something with a syntax error") produces different error messages under CPython 2.7
Besides the small repro below, please note that CPython 2.7 no longer exactly preserves whitespace as it was in the string passed to exec. E.g., "\r\n" is now consistently turned into "\n".
D:\rft\vsl\dlr\Languages\IronPython\Tests>26 -c "exec('print 1\ndef f()\rprint
3')"
Traceback (most recent call last):
File "
File "
print 3 f()
^
SyntaxError: invalid syntax
D:\rft\vsl\dlr\Languages\IronPython\Tests>27 -c "exec('print 1\ndef f()\rprint
3')"
Traceback (most recent call last):
File "
File "
def f()
^
SyntaxError: invalid syntax
Work Item Details
Original CodePlex Issue: Issue 28380 Status: Proposed Reason Closed: Unassigned Assigned to: Unassigned Reported on: Aug 2, 2010 at 6:12 PM Reported by: dfugate Updated on: Feb 22, 2013 at 2:10 AM Updated by: jdhardy Test: test_syntax.py (test_syntaxerror_text)