r prefix bug ... or my lack of understanding?

Bill Sneddon bsneddonNOspam at yahoo.com
Wed Jan 28 09:27:59 EST 2004


Below is from python 2.3.3 on windows.
I have tryed on Pythonwin and Idle and on
a Solaris unix build 2.2.2.

I know there are work arounds but the behavior
seems a bit strange to me.

 >>> path = r'c:\data'   #this is fine
 >>> print path
c:\data

 >>> path = r'c:\data\'
Traceback (  File "<interactive input>", line 1
     path = r'c:\data\'
                      ^
SyntaxError: EOL while scanning single-quoted string

 >>> path = r'c:\data\\'
 >>> print path
c:\data\\




More information about the Python-list mailing list