我在服务器上运行python代码(python 3.6)。它试图读取具有以下结构的csv文件:
I'll 510 676 1 Speaker2
come back 727 878 3 Speaker2
and wake you 930 1196 3 Speaker2
sp 1196 1242 99 Speaker2
in twenty 1109 1401 3 Speaker2
to 1544 1631 1 Speaker2
give you 1631 1952 3 Speaker2
这段代码:
with open(csvfile, 'r') as f:
lines = f.readlines()
返回此错误:
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 15-16: invalid continuation byte
答案 0 :(得分:0)
问题在于它不是真正的CSV。当我再次保存为CSV时,它有效!