[New-bugs-announce] [issue8700] strip() is removing an extra character if the strip pattern contains "-"

Balachander Ganesan report at bugs.python.org
Wed May 12 20:29:39 CEST 2010


New submission from Balachander Ganesan <gb.balachander at gmail.com>:

Version:
========
Python 2.4.3 (#1, Jan 14 2008, 18:31:21)
[GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux2

Description:
============
When the pattern used for strip contains "-" character then it removes one more characters next to it.

>>> a = 'image-abc-1.2.0-12_1234_123'
>>> b = a.strip('image-')
>>> print b
bc-1.2.0-12_1234_123


>From the above print statement we can see that instead of 'bc-1.2.0-12_1234_123', it prints only 'bc-1.2.0-12_1234_123'. 
The first character "a" next to "-" is missing.

----------
components: Library (Lib)
messages: 105598
nosy: Balachander.Ganesan
priority: normal
severity: normal
status: open
title: strip() is removing an extra character if the strip pattern contains "-"
type: behavior
versions: 3rd party

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


More information about the New-bugs-announce mailing list