Load json file as binary instead of decoding to string (#109351)

pull/109359/head
J. Nick Koston 2024-02-02 02:00:46 -06:00 committed by GitHub
parent 1c84997c5c
commit 155499fafe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ def load_json(
Defaults to returning empty dict if file is not found.
"""
try:
with open(filename, encoding="utf-8") as fdesc:
with open(filename, mode="rb") as fdesc:
return orjson.loads(fdesc.read()) # type: ignore[no-any-return]
except FileNotFoundError:
# This is not a fatal error