[New-bugs-announce] [issue5318] strip, rstrip & lstrip bug

alexlc report at bugs.python.org
Thu Feb 19 18:21:30 CET 2009


New submission from alexlc <alc at niebla.co.uk>:

Examples of bad behaviour:

>>> 'abacde'.lstrip('ab')
'cde'
>>> 'abaaacde'.lstrip('ab')
'cde'
>>> 'aabacde'.lstrip('aab')
'cde'
>>> 'abcede'.rstrip( 'de' )
'abc'
>>> 'abacdeaab'.strip('ab')
'cde'

Probably a few more similar to these will fail as well.

I have tested this with a fairly recent 2.5 (maybe 2.53 maybe 2.54), and
with 2.6.1. I have commented this to a friend and he recalls problems
similar to these with lstrip and rstrip a few years ago, so it might
have been an early 2.4 version or a late 2.3.

Thanks.

----------
components: Library (Lib)
messages: 82480
nosy: alexlc
severity: normal
status: open
title: strip, rstrip & lstrip bug
type: behavior
versions: Python 2.5, Python 2.6

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


More information about the New-bugs-announce mailing list