From 49ad7a719cfbeb42dd86dd3461d294b781208263 Mon Sep 17 00:00:00 2001 From: Jack Wilsdon Date: Sun, 19 Jun 2022 13:13:09 +0100 Subject: [PATCH] Open JSON files in binary mode This avoids any encoding errors caused by JSON files containing non-ASCII characters (e.g. emojis). --- itch_dl/handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/itch_dl/handlers.py b/itch_dl/handlers.py index ce1d5c1..e45faa1 100644 --- a/itch_dl/handlers.py +++ b/itch_dl/handlers.py @@ -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):