[issue17777] Unrecognized string literal escape sequences give SyntaxErrors

2013-09-24 Thread Tim Golden
Tim Golden added the comment: Closing as "Works for me" in the absence of any clear proposal for docs improvement. -- resolution: -> works for me stage: needs patch -> committed/rejected status: open -> closed ___ Python tracker

[issue17777] Unrecognized string literal escape sequences give SyntaxErrors

2013-09-23 Thread Mark Egan-Fuller
Mark Egan-Fuller added the comment: Python correctly throws a unicode error here, directing the user towards the fact that this is an issue specifically with the unicode escaping. >>> "\u" File "", line 1 SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-1:

[issue17777] Unrecognized string literal escape sequences give SyntaxErrors

2013-04-18 Thread Ezio Melotti
Changes by Ezio Melotti : -- keywords: +easy stage: -> needs patch type: behavior -> enhancement versions: +Python 2.7, Python 3.4 ___ Python tracker ___ ___

[issue17777] Unrecognized string literal escape sequences give SyntaxErrors

2013-04-17 Thread Reynir Reynisson
Reynir Reynisson added the comment: Thank you for the quick reply. Yes, something along those lines would help. Maybe adding "The escape sequence \x expects exactly two hex digits" would make it even clearer. -- ___ Python tracker

[issue17777] Unrecognized string literal escape sequences give SyntaxErrors

2013-04-17 Thread R. David Murray
R. David Murray added the comment: It is a recognized escape sequence, but the syntax of the escape sequence is wrong, thus the syntax error. An "escape sequence" is a backslash character followed by a letter. Perhaps that is the bit that needs to be clarified in the docs? -- nosy:

[issue17777] Unrecognized string literal escape sequences give SyntaxErrors

2013-04-17 Thread Reynir Reynisson
New submission from Reynir Reynisson: Strings like "\u" trigger a SyntaxError. According to the language reference "all unrecognized escape sequences are left in the string unchanged"[0]. The string "\u" clearly doesn't match any of the escape sequences (in particular \u). This may be int