String handling bug in Python

Colin Brown cbrown at metservice.com
Tue Apr 23 17:42:14 EDT 2002


I have entered the following at the command line in Python 2.1.1 on Linux
and in Python 2.2 on NT and get the same results:

>>> r'\'
  File "<string>", line 1
     r'\'
        ^
SyntaxError: invalid token
>>>

It appears as if the r option for strings does not handle a backslash as the
last string character properly.

Colin Brown
PyNZ






More information about the Python-list mailing list