From e4b6020f63d8a7f6077df2bd64e64c2793bf3d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Sat, 14 Dec 2019 09:30:58 -0500 Subject: [PATCH 1/2] Added stdout flush even for Python 2.x. --- bazarr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazarr.py b/bazarr.py index 83fa66ce5..ae5d88f13 100644 --- a/bazarr.py +++ b/bazarr.py @@ -51,9 +51,9 @@ def start_bazarr(): break if PY3: sys.stdout.buffer.write(line) - sys.stdout.flush() else: sys.stdout.write(line) + sys.stdout.flush() except KeyboardInterrupt: pass From 8d9023af80974ff09fef3fb8b5f2c51a4923de1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Sat, 14 Dec 2019 12:37:10 -0500 Subject: [PATCH 2/2] Small change to get output from ffprobe with Python 3.x --- libs/pyprobe/pyprobe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/pyprobe/pyprobe.py b/libs/pyprobe/pyprobe.py index b300965d5..59a6e5001 100644 --- a/libs/pyprobe/pyprobe.py +++ b/libs/pyprobe/pyprobe.py @@ -179,9 +179,9 @@ class VideoFileParser: if PY3: command = [parser] + commandArgs + [inputFile] completedProcess = subprocess.run( - command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8" + command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True ) - if completedProcess.returncode != 0: + if completedProcess.returncode: raise IOError( "Error occurred during execution - " + completedProcess.stderr )