[New-bugs-announce] [issue14147] print r"\" cause SyntaxError

lilei report at bugs.python.org
Tue Feb 28 09:47:30 CET 2012

New submission from lilei <vbem at 163.com>:

$ python
Python 2.7.1 (r271:86832, Apr 16 2011, 23:27:12) 
[GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print r'\'
  File "<stdin>", line 1
    print r'\'
SyntaxError: EOL while scanning string literal

I just want to print a raw string r'\', however, SyntaxError.
What is the reason?

components: None
messages: 154538
nosy: vbem
priority: normal
severity: normal
status: open
title: print r"\" cause SyntaxError
type: behavior
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list