[New-bugs-announce] [issue21283] A escape character is used when a REGEXP is an argument of "strip" string function

Tito Bouzout report at bugs.python.org
Thu Apr 17 15:54:45 CEST 2014


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 there is that the "strip" argument should be a "string" not a REGEXP.

Kinda weird to read, and I've no idea if this is expected behaviour in Python, as I'm relatively very new. So just informing, 

Kind regards, 

-- 
Tito

----------
components: Regular Expressions
messages: 216687
nosy: Tito.Bouzout, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: A escape character is used when a REGEXP is an argument of "strip" string function
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21283>
_______________________________________


More information about the New-bugs-announce mailing list