1

I trid to load json file with standart json library. It's works good but slowly:

with open(file, 'r', encoding="utf-8") as jfile:
    lines = json.loads(jfile.read())

I try orjson librery, but the same code rise JSONDecodeError: str is not valid UTF-8

with open(file, 'r', encoding="utf-8") as jfile:
    lines = orjson.loads(jfile.read())

How to handle this error?

Myky
  • 21
  • 2

0 Answers0