Open olixbridge opened 5 years ago
(venv) (Python37) Olivias-MBP:python oliviashi$ python3 /Users/oliviashi/Documents/software/python/DataGenerator.py
Traceback (most recent call last):
File "/Users/oliviashi/Documents/software/python/DataGenerator.py", line 31, in
same issue here
just change the line: with open(input_file) as f: to with open(input_file, encoding='windows-1252') as f:
or you can:
open(input_file,'rb') as f: book = f.read().decode(errors='replace')
I did very similar to the code and I replaced the path by path = '/Users/oliviashi/Documents/software/python/books/'
However I cannot run the file because: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 3131: invalid start byte
What should I do? Thank you very much!