[issue4054] str.split unintentionally strips char 'I' from the string
Govind
report at bugs.python.org
Mon Oct 6 15:04:30 CEST 2008
New submission from Govind <avgovind at hotmail.com>:
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
----------
files: file.txt
messages: 74368
nosy: Govind
severity: normal
status: open
title: str.split unintentionally strips char 'I' from the string
type: behavior
Added file: http://bugs.python.org/file11710/file.txt
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4054>
_______________________________________
More information about the Python-bugs-list
mailing list