diff --git a/common/lib/xmodule/xmodule/tests/test_video.py b/common/lib/xmodule/xmodule/tests/test_video.py
index 707235af62..5b8457f68a 100644
--- a/common/lib/xmodule/xmodule/tests/test_video.py
+++ b/common/lib/xmodule/xmodule/tests/test_video.py
@@ -826,8 +826,8 @@ class VideoExportTestCase(VideoBlockTestBase):
"""
self.descriptor.transcripts = None
xml = self.descriptor.definition_to_xml(self.file_system)
- expected = '\n'
- self.assertEquals(expected, etree.tostring(xml, pretty_print=True).decode('utf-8'))
+ expected = b'\n'
+ self.assertEquals(expected, etree.tostring(xml, pretty_print=True))
@patch('xmodule.video_module.video_module.edxval_api', None)
def test_export_to_xml_invalid_characters_in_attributes(self):
diff --git a/common/lib/xmodule/xmodule/video_module/transcripts_utils.py b/common/lib/xmodule/xmodule/video_module/transcripts_utils.py
index 87b11c953b..addf73a08f 100644
--- a/common/lib/xmodule/xmodule/video_module/transcripts_utils.py
+++ b/common/lib/xmodule/xmodule/video_module/transcripts_utils.py
@@ -185,7 +185,7 @@ def get_transcripts_from_youtube(youtube_id, settings, i18n, youtube_transcript_
raise GetTranscriptsFromYouTubeException(msg)
sub_starts, sub_ends, sub_texts = [], [], []
- xmltree = etree.fromstring(data.content.encode('utf-8'), parser=utf8_parser)
+ xmltree = etree.fromstring(data.content, parser=utf8_parser)
for element in xmltree:
if element.tag == "text":
start = float(element.get("start"))
@@ -812,11 +812,11 @@ class VideoTranscriptsMixin(object):
log.debug("No subtitles for 'en' language")
raise ValueError
- data = Transcript.asset(self.location, transcript_name, lang).data
+ data = Transcript.asset(self.location, transcript_name, lang).data.decode('utf-8')
filename = u'{}.{}'.format(transcript_name, transcript_format)
content = Transcript.convert(data, 'sjson', transcript_format)
else:
- data = Transcript.asset(self.location, None, None, other_lang[lang]).data
+ data = Transcript.asset(self.location, None, None, other_lang[lang]).data.decode('utf-8')
filename = u'{}.{}'.format(os.path.splitext(other_lang[lang])[0], transcript_format)
content = Transcript.convert(data, 'srt', transcript_format)
diff --git a/common/lib/xmodule/xmodule/video_module/video_module.py b/common/lib/xmodule/xmodule/video_module/video_module.py
index 01d5a77072..6943633793 100644
--- a/common/lib/xmodule/xmodule/video_module/video_module.py
+++ b/common/lib/xmodule/xmodule/video_module/video_module.py
@@ -481,7 +481,7 @@ class VideoBlock(
'There is no transcript file associated with the {lang} language.',
'There are no transcript files associated with the {lang} languages.',
len(no_transcript_lang)
- ).format(lang=', '.join(no_transcript_lang))
+ ).format(lang=', '.join(sorted(no_transcript_lang)))
)
)
return validation
diff --git a/lms/djangoapps/courseware/tests/test_video_handlers.py b/lms/djangoapps/courseware/tests/test_video_handlers.py
index f749bcf9c2..38bc600e8f 100644
--- a/lms/djangoapps/courseware/tests/test_video_handlers.py
+++ b/lms/djangoapps/courseware/tests/test_video_handlers.py
@@ -1282,12 +1282,12 @@ class TestGetTranscript(TestVideo):
transcripts = self.item.get_transcripts_info()
text, filename, mime_type = self.item.get_transcript(transcripts)
- expected_text = textwrap.dedent("""
+ expected_text = textwrap.dedent(u"""
0
00:00:00,12 --> 00:00:00,100
Привіт, edX вітає вас.
""")
- self.assertEqual(text.decode('utf-8') if six.PY3 else text, expected_text)
+ self.assertEqual(text, expected_text)
self.assertEqual(filename, u"塞.srt")
self.assertEqual(mime_type, 'application/x-subrip; charset=utf-8')