Tito Bouzout added the comment:
Thanks guys for the information! Is still weird to me that the escape character
is used, but well ! Will remember this bug.
Kind regards,
--
___
Python tracker rep...@bugs.python.org
New submission from Tito Bouzout:
Hello!
I got a report that the character \ was removed from a string using the
following code
\\server\path\to.strip(r'\'')
At first insight, looks like a bug, because I don't expect the use of the
escape character at all. Then I noticed, that our mistake
Matthew Barnett added the comment:
The argument isn't a regex, it's a raw string literal consisting of the
characters (quote), \ (backslash), ' (apostrophe), (less than) and
(greater than).
--
___
Python tracker rep...@bugs.python.org
Eric V. Smith added the comment:
In addition, you probably want \\server\path\to to be a raw string, too. That
way, the backslashes are not given special meaning. Notice the difference in
output between these two:
\\server\path\to.strip(r'\'')
'server\\path\to'