Commit 1813b22a by Julian Arni

Fix import errors with unicode filenames

parent 70cc5008
...@@ -154,7 +154,7 @@ def import_course(request, org, course, name): ...@@ -154,7 +154,7 @@ def import_course(request, org, course, name):
sf.write("Extracting") sf.write("Extracting")
tar_file = tarfile.open(temp_filepath) tar_file = tarfile.open(temp_filepath)
tar_file.extractall(course_dir + '/') tar_file.extractall((course_dir + '/').encode('utf-8'))
with open(status_file, 'w+') as sf: with open(status_file, 'w+') as sf:
sf.write("Verifying") sf.write("Verifying")
......
...@@ -31,7 +31,7 @@ def import_static_content(modules, course_loc, course_data_path, static_content_ ...@@ -31,7 +31,7 @@ def import_static_content(modules, course_loc, course_data_path, static_content_
try: try:
content_path = os.path.join(dirname, filename) content_path = os.path.join(dirname, filename)
if verbose: if verbose:
log.debug('importing static content {0}...'.format(content_path)) log.debug('importing static content {0}...'.format(content_path.encode("utf-8")))
fullname_with_subpath = content_path.replace(static_dir, '') # strip away leading path from the name fullname_with_subpath = content_path.replace(static_dir, '') # strip away leading path from the name
if fullname_with_subpath.startswith('/'): if fullname_with_subpath.startswith('/'):
......
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