From df31c030865a03dc3514148f108c5e9443352b96 Mon Sep 17 00:00:00 2001 From: Zowie Date: Wed, 22 Feb 2017 19:30:12 +0100 Subject: [PATCH] Handle bytes when listing fonts in VideoClip.py (#306) Handle bytes when listing fonts in VideoClip.py --- moviepy/video/VideoClip.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/moviepy/video/VideoClip.py b/moviepy/video/VideoClip.py index ab52bccc1..7e1c1b9e4 100644 --- a/moviepy/video/VideoClip.py +++ b/moviepy/video/VideoClip.py @@ -1202,9 +1202,12 @@ def list(arg): lines = result.splitlines() if arg == 'font': - return [l[8:] for l in lines if l.startswith(" Font:")] + return [l.decode('UTF-8')[8:] for l in lines if l.startswith(b" Font:")] elif arg == 'color': - return [l.split(" ")[1] for l in lines[2:]] + return [l.split(b" ")[0] for l in lines[2:]] + else: + raise Exception("Moviepy:Error! Argument must equal " + "'font' or 'color'") @staticmethod def search(string, arg):