0

I am trying to open a 14.6GB .lst file. Which encoding should I use? I always get the error, I am using Python3

  File "fb.py", line 58, in <module>
    passw=file.readline().strip()
  File "/usr/lib/python3.7/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc7 in position 237: invalid continuation byte
anonym
  • 17
  • 4
  • Try with `encoding='latin1'` – Celius Stingher Mar 09 '20 at 12:43
  • Does this answer your question? ["for line in..." results in UnicodeDecodeError: 'utf-8' codec can't decode byte](https://stackoverflow.com/questions/19699367/for-line-in-results-in-unicodedecodeerror-utf-8-codec-cant-decode-byte) – Masklinn Mar 09 '20 at 12:47

1 Answers1

1

You don't have utf-8 data. Try changing the encoding to "ISO-8859-1" in your open() statement.

Bert
  • 2,134
  • 19
  • 19