strip module bug

Poppy znfmail-pythonlang at yahoo.com
Mon Oct 13 08:50:41 EDT 2008


I'm using versions 2.5.2 and 2.5.1 of python and have encountered a 
potential bug. Not sure if I'm misunderstanding the usage of the strip 
function but here's my example.

var = "detail.xml"
print var.strip(".xml")   ### expect to see 'detail', but get 'detai'
var = "overview.xml"
print var.strip(".xml") ### expect and get 'overview'

I have a work around using the replace function which happens to be the 
better choice for my script anyhow. But am curious about the strip module. 
Any thoughts? Is it removing the 'l' in detail because the strip function 
text ends in 'l'?





More information about the Python-list mailing list