From 055eb7b04dc93f736c2be4107eba88c10264d451 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Sun, 19 Mar 2023 21:48:22 +0100 Subject: [PATCH] Fix transcoder utf8 decoder error handling --- transcoder/transcode_dvd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transcoder/transcode_dvd.py b/transcoder/transcode_dvd.py index feb8dff..e8b31a4 100755 --- a/transcoder/transcode_dvd.py +++ b/transcoder/transcode_dvd.py @@ -294,7 +294,7 @@ def run_and_log_handbrake(dvd: Dvd, command) -> bool: # Handbrake often exits with returncode 0 even though it logged an error and transcoding was not successful def check_handbrake_log_for_error(dvd: Dvd): - with open(dvd.log_file, "r") as log_file: + with open(dvd.log_file, "r", encoding="utf-8", errors="ignore") as log_file: for line in log_file: if line.startswith("Encode failed"): return True @@ -328,7 +328,7 @@ def find_series_titles(dvd: Dvd): if proc.returncode != 0: return None - stdout = proc.stdout.decode("utf-8", errors="replace") + stdout = proc.stdout.decode("utf-8", errors="ignore") json_str = "" in_json = False