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
This commit is contained in:
aarif
2019-09-02 20:03:06 +05:00
parent b3737ff95a
commit 8e7406493c

View File

@@ -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