This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: listname.strip() does not work right if the name ends with an 'o'
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: SilentGhost, dileep k
Priority: normal Keywords:

Created on 2016-04-11 19:57 by dileep k, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg263203 - (view) Author: dileep k (dileep k) Date: 2016-04-11 19:57
12:54:38 | ~ | #1 $ python -V
Python 2.7.6

12:54:41 | ~ | #2 $ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> 'media.log'.strip('.log')
'media'

>>> 'video.log'.strip('.log')
'vide'

>>> 

The output should have been 'video' instead of 'vide' !
msg263204 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-04-11 20:03
Documentation [0] has a very clear explanation of how str.strip works.

[0] https://docs.python.org/2/library/stdtypes.html#str.strip
History
Date User Action Args
2022-04-11 14:58:29adminsetgithub: 70925
2016-04-11 20:03:43SilentGhostsetstatus: open -> closed

nosy: + SilentGhost
messages: + msg263204

resolution: not a bug
stage: resolved
2016-04-11 19:58:04dileep ksettitle: listname.strip does not work right if the name ends with an 'o' -> listname.strip() does not work right if the name ends with an 'o'
2016-04-11 19:57:32dileep kcreate