Open JSON files in binary mode

This avoids any encoding errors caused by JSON files containing
non-ASCII characters (e.g. emojis).
This commit is contained in:
Jack Wilsdon 2022-06-19 13:13:09 +01:00 committed by Dragoon Aethis
parent 8ae034a139
commit 49ad7a719c

View File

@ -150,7 +150,7 @@ def get_jobs_for_itch_url(url: str, client: ItchApiClient) -> List[str]:
def get_jobs_for_path(path: str) -> List[str]:
try: # Game Jam Entries JSON?
with open(path) as f:
with open(path, "rb") as f:
json_data = json.load(f)
if not isinstance(json_data, dict):