From 8e7406493c4fe573288f076011a82cd7f5170dfc Mon Sep 17 00:00:00 2001 From: aarif Date: Mon, 2 Sep 2019 20:03:06 +0500 Subject: [PATCH] python 3 fixes test fixes changes made as suggested test fixes test fixes for python 2 test fixes python 3 fixes test fixes changes made as suggested test fixes test fixes for python 2 test fixes minor fixes python 3 fixes minor changes --- common/lib/xmodule/xmodule/video_module/transcripts_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/video_module/transcripts_utils.py b/common/lib/xmodule/xmodule/video_module/transcripts_utils.py index 5a513bca58..bc8743b3c3 100644 --- a/common/lib/xmodule/xmodule/video_module/transcripts_utils.py +++ b/common/lib/xmodule/xmodule/video_module/transcripts_utils.py @@ -654,7 +654,7 @@ class Transcript(object): if input_format == 'srt': if output_format == 'txt': - text = SubRipFile.from_string(content.decode('utf8')).text + text = SubRipFile.from_string(content.decode('utf-8')).text return HTMLParser().unescape(text) elif output_format == 'sjson': @@ -663,7 +663,7 @@ class Transcript(object): # the exception if something went wrong in parsing the transcript. srt_subs = SubRipFile.from_string( # Skip byte order mark(BOM) character - content.decode('utf-8-sig'), + content.decode('utf-8-sig') if six.PY2 else content.encode('utf-8').decode('utf-8-sig'), error_handling=SubRipFile.ERROR_RAISE ) except Error as ex: # Base exception from pysrt