New submission from Govind <[EMAIL PROTECTED]>: 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 <[EMAIL PROTECTED]> <http://bugs.python.org/issue4054> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com