0

I am running a python code on server (python 3.6). It tries to read a csv file which has this structure:

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

This piece of code:

with open(csvfile, 'r') as f:
   lines = f.readlines()

returns this error:

UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 15-16: invalid continuation byte

I tried this and this but it didn't work

Hackerman
  • 12,139
  • 2
  • 34
  • 45
user552231
  • 1,095
  • 3
  • 21
  • 40

1 Answers1

0

The problem was that it wasn't a real CSV. When I saved as CSV again, it worked!

user552231
  • 1,095
  • 3
  • 21
  • 40