o1da
2015-06-13 13:29:53 UTC
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.
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 <***@bugs.python.org>
<http://bugs.python.org/issue24445>
_______________________________________
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.rstrip('.jp2')
text = 'test1.jp2'
text.rstrip('.jp2')
'test1'text.rstrip('.jp2')
text = 'test1/2.jp2'
text.rstrip('.jp2')
'test1/'text.rstrip('.jp2')
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 <***@bugs.python.org>
<http://bugs.python.org/issue24445>
_______________________________________