[ python-Bugs-1196824 ] string.rstrip strips more than supposed to in some cases

SourceForge.net noreply at sourceforge.net
Fri May 6 21:53:55 CEST 2005


Bugs item #1196824, was opened at 2005-05-06 19:46
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1196824&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Francois Payette (headgasket-)
Assigned to: Nobody/Anonymous (nobody)
Summary: string.rstrip strips more than supposed to in some cases

Initial Comment:

import string


lfile  = "test.zip.gpg"
print lfile
lfile = lfile.rstrip(".gpg")
print lfile

should result in the same thing as:


lfile  = "test.zip.gpg"
print lfile
lfile = lfile.rstrip("gpg")
lfile = lfile.rstrip(".")
print lfile

but it does not

----------------------------------------------------------------------

Comment By: Georg Brandl (gbrandl)
Date: 2005-05-06 19:53

Message:
Logged In: YES 
user_id=849994

This is not a bug. The argument to rstrip is a string that
contains the individual characters that are to be removed.
They can occur in any order and quantity at the end of the
string.

----------------------------------------------------------------------

Comment By: Francois Payette (headgasket-)
Date: 2005-05-06 19:46

Message:
Logged In: YES 
user_id=1273811

version 2.4.1

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1196824&group_id=5470


More information about the Python-bugs-list mailing list