Помогите новичку!
Обрабатываю большой txt - файл. Вот код:
# coding: utf8
file = open('_Origin.txt')
supplier = {}
for i in range(1,50000):
line = file.readline()
key = line.split(';')
if key in supplier :
tmp = supplier.get(key)
supplier.update({key:tmp + 1})
else:
supplier.update({key:1})
print (supplier)
Обрабатывает примерно 45000 строк и выдает ошибку:
Traceback (most recent call last):
……, line 7, in <module>
line = file.readline()
File “C:\Python33\lib\encodings\cp1251.py”, line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)
UnicodeDecodeError: ‘charmap’ codec can't decode byte 0x98 in position 479: character maps to <undefined>
Почему??