Wow... took someone else to point this out to me.. Kinda feel like an idiot for responding :)<br><br>rstrip doesn't take a string... it removes all the chars that you list individually... <br><br>that's why the e was removed... there's an e in .torrent but it hit the x which it didn't match on, so it stopped... that's why the other e was left. 
<br><br><div><span class="gmail_quote">On 11/22/07, <b class="gmail_sendername">Tyler Reguly</b> <<a href="mailto:ht@computerdefense.org">ht@computerdefense.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Interesting... I tried this on three machines Windows/Python 2.4.3, FC4/Python 2.4.3, Ubuntu/Python 2.5.1 and I saw the same thing for each... It's apparently not a three character issue but rather related to specific characters (e, n, o, r, t). A further test revealed that this affects one additional character... the . (period/dot) character.
<br><br>Here's what I did to test it:<br><br>for i in range(97,123):<br> x = 'ab' + chr(i) + '.torrent'<br> y = x.rstrip('.torrent')<br> print ('Before: %s (%d)\tAfter: %s (%d)' % (x, len(x), y, len(y) ) )
<br><br>Before: abcdefga.torrent (16)   After: abcdefga (8)<br>Before: abcdefgb.torrent (16)   After: abcdefgb (8)<br>Before: abcdefgc.torrent (16)   After: abcdefgc (8)<br>Before: abcdefgd.torrent (16)   After: abcdefgd (8)
<br>Before: abcdefge.torrent (16)   After: abcdefg (7)<br>Before: abcdefgf.torrent (16)   After: abcdefgf (8)<br>Before: abcdefgg.torrent (16)   After: abcdefgg (8)<br>Before: abcdefgh.torrent (16)   After: abcdefgh (8)<br>

Before: abcdefgi.torrent (16)   After: abcdefgi (8)<br>Before: abcdefgj.torrent (16)   After: abcdefgj (8)<br>Before: abcdefgk.torrent (16)   After: abcdefgk (8)<br>Before: abcdefgl.torrent (16)   After: abcdefgl (8)<br>
Before: 
abcdefgm.torrent (16)   After: abcdefgm (8)<br>Before: abcdefgn.torrent (16)   After: abcdefg (7)<br>Before: abcdefgo.torrent (16)   After: abcdefg (7)<br>Before: abcdefgp.torrent (16)   After: abcdefgp (8)<br>Before: abcdefgq.torrent

 (16)   After: abcdefgq (8)<br>Before: abcdefgr.torrent (16)   After: abcdefg (7)<br>Before: abcdefgs.torrent (16)   After: abcdefgs (8)<br>Before: abcdefgt.torrent (16)   After: abcdefg (7)<br>Before: abcdefgu.torrent (16)   After: abcdefgu (8)
<br>Before: abcdefgv.torrent (16)   After: abcdefgv (8)<br>Before: abcdefgw.torrent (16)   After: abcdefgw (8)<br>Before: abcdefgx.torrent (16)   After: abcdefgx (8)<br>Before: abcdefgy.torrent (16)   After: abcdefgy (8)
<br>
Before: abcdefgz.torrent (16)   After: abcdefgz (8)<br><br><br><br>Before: aba.torrent (11)        After: aba (3)<br>Before: abb.torrent (11)        After: abb (3)<br>Before: abc.torrent (11)        After: abc (3)<br>Before: 
abd.torrent (11)        After: abd (3)<br>Before: abe.torrent (11)        After: ab (2)<br>Before: abf.torrent (11)        After: abf (3)<br>Before: abg.torrent (11)        After: abg (3)<br>Before: abh.torrent (11)        After: abh (3)
<br>Before: abi.torrent (11)        After: abi (3)<br>Before: abj.torrent (11)        After: abj (3)<br>Before: abk.torrent (11)        After: abk (3)<br>Before: abl.torrent (11)        After: abl (3)<br>Before: abm.torrent

 (11)        After: abm (3)<br>Before: abn.torrent (11)        After: ab (2)<br>Before: abo.torrent (11)        After: ab (2)<br>Before: abp.torrent (11)        After: abp (3)<br>Before: abq.torrent (11)        After: abq (3)
<br>Before: abr.torrent (11)        After: ab (2)<br>Before: abs.torrent (11)        After: abs (3)<br>Before: abt.torrent (11)        After: ab (2)<br>Before: abu.torrent (11)        After: abu (3)<br>Before: abv.torrent

 (11)        After: abv (3)<br>Before: abw.torrent (11)        After: abw (3)<br>Before: abx.torrent (11)        After: abx (3)<br>Before: aby.torrent (11)        After: aby (3)<br>Before: abz.torrent (11)        After: abz (3)
<div><span class="e" id="q_1166acfe22a38521_1"><br><br><br><div><span class="gmail_quote">On 11/22/07, <b class="gmail_sendername">kyo guan</b> <<a href="mailto:kyoguan@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
kyoguan@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi :<br><br>        Please look at this code:<br><br>>>> 'exe.torrent'.rstrip('.torrent')<br>'ex'                    <-----  it should be 'exe', why?<br><br>but this is a right answer:
<br><br>>>> '120.exe'.rstrip('.exe')<br>'120'                   <------ this is a right value.<br><br>        there is a bug in the rstrip, lstrip there isn't this problem.<br><br>
<br>
<br>Kyo.<br><br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mail.python.org/mailman/listinfo/python-list</a><br></blockquote>
</div><br>
</span></div></blockquote></div><br>