codecs.open problem

gabor gabor at z10n.net
Thu Mar 13 10:34:55 EST 2003


hi,


import codecs

file = codecs.open('input.txt',encoding='utf-8')
data = file.read()
print type(data)
unicode

file = codecs.open('input.txt',encoding='utf-8')
data = file.readlines()
print type(data)
list-of-unicodes

file = codecs.open('input.txt',encoding='utf-8')
for line in file:
	print type(line)
str
str
str
str
str


so, why is the for-line-in-file construct return strings?
it should return unicodes, or not?

gabor
-- 






More information about the Python-list mailing list