From db7951ced2749da0ac4537807b817aab40b916e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Sun, 5 Jan 2020 10:33:36 -0500 Subject: [PATCH] Fix for #737. --- bazarr/get_subtitle.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bazarr/get_subtitle.py b/bazarr/get_subtitle.py index 81d2e8a6e..be4d36ad2 100644 --- a/bazarr/get_subtitle.py +++ b/bazarr/get_subtitle.py @@ -249,6 +249,11 @@ def download_subtitle(path, language, hi, forced, providers, providers_auth, sce if os.name == 'nt': out = out.decode(encoding) + + try: + out = out.decode(sys.stdout.encoding) + except (UnicodeDecodeError, AttributeError): + pass except: if out == "": @@ -474,6 +479,11 @@ def manual_download_subtitle(path, language, hi, forced, subtitle, provider, pro if os.name == 'nt': out = out.decode(encoding) + + try: + out = out.decode(sys.stdout.encoding) + except (UnicodeDecodeError, AttributeError): + pass except: if out == "":