[New-bugs-announce] [issue24445] rstrip strips what it doesn't have to

o1da report at bugs.python.org
Sat Jun 13 15:29:53 CEST 2015


New submission from o1da:

Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> text = 'test1/1.jp2'
>>> text.rstrip('.jp2')
'test1/1'
>>> text = 'test1.jp2'
>>> text.rstrip('.jp2')
'test1'
>>> text = 'test1/2.jp2'
>>> text.rstrip('.jp2')
'test1/'
>>> 

Why the rstrip function stripped '2' from the last example? I think that it is a bug.

----------
messages: 245311
nosy: o1da
priority: normal
severity: normal
status: open
title: rstrip strips what it doesn't have to
versions: Python 2.7

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


More information about the New-bugs-announce mailing list