[Python-bugs-list] [ python-Bugs-594063 ] r'\' => Syntax error

noreply@sourceforge.net noreply@sourceforge.net
Mon, 12 Aug 2002 07:32:59 -0700


Bugs item #594063, was opened at 2002-08-12 14:32
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=594063&group_id=5470

Category: Parser/Compiler
Group: Python 2.1.1
Status: Open
Resolution: None
Priority: 5
Submitted By: a.hofkamp (axhlkhb)
Assigned to: Nobody/Anonymous (nobody)
Summary: r'\' => Syntax error

Initial Comment:
The raw string is supposed to treat \ as literal
characters. It does that with

>>> print r'\aslkjv'
\aslkjv

and

>>> print r'\'kdsr'
\'kdsr

but not with

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

In the last case, I intend to have a string containing
a \ only.

This happens with Python 1.5.2 and 2.1.1
(on FreeBSD and/or Linux)


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=594063&group_id=5470