"Rob Cliffe" writes:
> Syntax Error: EOL while scanning single-quoted string.
[…]
> Isn't this a bug?
It has a report http://bugs.python.org/issue1271> but is not a bug
http://www.python.org/doc/faq/general/#why-can-t-raw-strings-r-strings-end-with-a-backslash>.
--
\ “Broken promise
Python (e.g. 2.5) does not accept a backslash as the LAST character of a raw
string:
>>> r"\"
File "", line 1
r"\"
^
Syntax Error: EOL while scanning single-quoted string.
path = r'\MyDir\MySubDir\' # raises same error
path = r'\MyDir\MySubDir' # no error
Isn't this a bug?
Rob