Fix import errors with unicode filenames
This commit is contained in:
@@ -154,7 +154,7 @@ def import_course(request, org, course, name):
|
||||
sf.write("Extracting")
|
||||
|
||||
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:
|
||||
sf.write("Verifying")
|
||||
|
||||
@@ -31,7 +31,7 @@ def import_static_content(modules, course_loc, course_data_path, static_content_
|
||||
try:
|
||||
content_path = os.path.join(dirname, filename)
|
||||
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
|
||||
if fullname_with_subpath.startswith('/'):
|
||||
|
||||
Reference in New Issue
Block a user