Title: string literal continuation lines don't work with dos line endings
Type: behaviour Severity: normal
Components: Core Versions: 2.5alpha1
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, luckmor, wesleys
Priority: Keywords:

Created on 2008-08-19.03:00:15 by luckmor, last changed 2008-09-13.17:39:27 by fwierzbicki.

msg3435 (view) Author: David Morley (luckmor) Date: 2008-08-19.03:00:14
Parsing a string literal containing the character sequence backslash, 
cr, and linefeed (such as you would find in a string literal 
continuation line in a file with dos line endings) raises a cryptic 
>>> eval('"\\\r\n"')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 0
SyntaxError: mismatched input  expecting Type (<string>, line 0)
msg3448 (view) Author: Wesley Schwengle (wesleys) Date: 2008-08-26.08:25:24
Your code raises an exception in python 2.5.1 as well:

>>> eval('"\\\r\n"')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1
SyntaxError: EOL while scanning single-quoted string

I agree the message is not that clear, but running the same code in
python tells you exactly what's going on.
msg3513 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2008-09-13.17:39:27
Since this fails in CPython too, I'm closing it.  If the submitter wants
to put in another bug "Exception messages for parse errors need to match
better", I'd be fine with that.
Date User Action Args
2008-09-13 17:39:27fwierzbickisetstatus: open -> closed
resolution: wont fix
messages: + msg3513
nosy: + fwierzbicki
2008-08-26 08:25:25wesleyssetnosy: + wesleys
messages: + msg3448
2008-08-19 03:00:15luckmorcreate