From 90645838538bb7346ff9cb60eb76302526e5eb92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Fri, 3 May 2019 09:34:08 -0400 Subject: [PATCH] Fix for non UTF8 file system encoding. --- bazarr/embedded_subs_reader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bazarr/embedded_subs_reader.py b/bazarr/embedded_subs_reader.py index b4961f7d9..0c4a3a100 100644 --- a/bazarr/embedded_subs_reader.py +++ b/bazarr/embedded_subs_reader.py @@ -2,6 +2,7 @@ import enzyme import logging import os import subprocess +import locale from utils import get_binary @@ -18,7 +19,7 @@ class EmbeddedSubsReader: def list_languages(self, file): if self.ffprobe: try: - return subprocess.check_output([self.ffprobe, "-loglevel", "error", "-select_streams", "s", "-show_entries", "stream_tags=language", "-of", "csv=p=0", file], universal_newlines=True, stderr=subprocess.STDOUT).strip().split("\n") + return subprocess.check_output([self.ffprobe, "-loglevel", "error", "-select_streams", "s", "-show_entries", "stream_tags=language", "-of", "csv=p=0", file.encode(locale.getpreferredencoding())], universal_newlines=True, stderr=subprocess.STDOUT).strip().split("\n") except subprocess.CalledProcessError as e: raise FFprobeError(e.output) if os.path.splitext(file)[1] != '.mkv':