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.

Author Govind
Recipients Govind
Date 2008-10-06.13:04:29
SpamBayes Score 1.256002e-10
Marked as misclassified No
Message-id <1223298270.23.0.44559787847.issue4054@psf.upfronthosting.co.za>
In-reply-to
Content
I tried to process a text file (with UTF-8 encoding) which has 
contents like this:


FILE=India
asbds
FILE=Indonasia
ssgsds
FILE=Africa
DBGDGDFG

When I use the below code:
>>> f = open("e:\\temp\\file.txt", 'r')
>>> lines = f.readlines()
>>> for line in lines:
	if line.startswith("FILE="):
		print line.strip("FILE=")


I get output as:
ndia

ndonasia

Africa


I is always stripped if it follows the substring that I want to strip 
off.

Am I doing something wrong here or is this a bug in Python?

-Govind
History
Date User Action Args
2008-10-06 13:04:30Govindsetrecipients: + Govind
2008-10-06 13:04:30Govindsetmessageid: <1223298270.23.0.44559787847.issue4054@psf.upfronthosting.co.za>
2008-10-06 13:04:29Govindlinkissue4054 messages
2008-10-06 13:04:29Govindcreate