0

When I run pypy3 file.py, I get an UnicodeDecodeError, because file.csv contains some UTF-8 characters.

However, when I run python3 file.py, everything works fine.

The key part of file.py:

with open("file.csv") as f:
    reader = csv.reader(f, delimiter=",", quotechar="\"")
    next(reader)

Any ideas which way pypy3 needs to be tampered with so that it works?

karlosss
  • 2,816
  • 7
  • 26
  • 42
  • 2
    Likely dupe of https://stackoverflow.com/questions/47948518/reading-utf-8-encoded-files-and-text-files-in-python3 - if you specify the encoding when opening the file it shouldn't matter which interpreter you use. – Peter DeGlopper May 07 '19 at 17:20
  • That's it, `encoding="utf8"` did it! Do you want to write it as the answer? – karlosss May 07 '19 at 19:23

0 Answers0