[New-bugs-announce] [issue42313] rstrip removes the trailing `e`s.

Athul R report at bugs.python.org
Tue Nov 10 10:31:08 EST 2020


New submission from Athul R <athulkannadi at gmail.com>:

rstrip removes the trailing `e`s. 

i = "external_eeeeeeeee_object"
i = i.rstrip('_object')
print(i) 
"""
It should have printed `external_eeeeeeeee` but it prints only `external_`. 
"""

It happens only when I user rstrip("_object") not for other strings. 

# =======================================================
# it works fine in the below case. 


i = "external_eeeeeeeee_trail"
i = i.rstrip('_trail')
print(i) 
"""
It should have prints `external_eeeeeeeee`
"""

----------
components: Library (Lib)
files: python-bug.py
messages: 380678
nosy: Athul-R
priority: normal
severity: normal
status: open
title: rstrip removes the trailing `e`s.
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file49590/python-bug.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42313>
_______________________________________


More information about the New-bugs-announce mailing list