Skip to content
Snippets Groups Projects
Unverified Commit 4e95024d authored by Aarif's avatar Aarif Committed by GitHub
Browse files

Merge pull request #21525 from edx/BOM-367

BOM-367 Python 3 fixes
parents 22992029 8e740649
No related merge requests found
......@@ -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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment