Commit 9c73b88c by Tyler Hallada

Write in byte mode instead

parent 064cb036
...@@ -803,8 +803,8 @@ def export_to_xml(video_ids, course_id=None, external=False, video_download_dir= ...@@ -803,8 +803,8 @@ def export_to_xml(video_ids, course_id=None, external=False, video_download_dir=
video_url = unicode(getattr(encoded_video, 'url')) video_url = unicode(getattr(encoded_video, 'url'))
exported_url = '{}/{}'.format(video_download_dir, video_url.split('/')[-1]) exported_url = '{}/{}'.format(video_download_dir, video_url.split('/')[-1])
resp = urllib2.urlopen(video_url) resp = urllib2.urlopen(video_url)
with resource_fs.open(exported_url, 'w') as f: with resource_fs.open(exported_url, 'wb') as f:
f.write(unicode(resp.read())) f.write(resp.read())
attributes['url'] = exported_url attributes['url'] = exported_url
else: else:
attributes = { attributes = {
......
Markdown is supported
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