Myky
Myky

Reputation: 21

Python's orjson rised JSONDecodeError: str is not valid UTF-8

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?

Upvotes: 1

Views: 1187

Answers (0)

Related Questions