Skip to content
Snippets Groups Projects
Commit 50ab035d authored by Feanil Patel's avatar Feanil Patel
Browse files

Make the file name not have a 'b' prefix.

We make sure the temp file name is a string because we combine it with
other string components with path later.
parent 597c5d5f
No related merge requests found
...@@ -32,7 +32,7 @@ from opaque_keys.edx.locator import LibraryLocator, BlockUsageLocator ...@@ -32,7 +32,7 @@ from opaque_keys.edx.locator import LibraryLocator, BlockUsageLocator
from organizations.models import OrganizationCourse from organizations.models import OrganizationCourse
from path import Path as path from path import Path as path
from pytz import UTC from pytz import UTC
from six import iteritems, text_type from six import iteritems, text_type, binary_type
from six.moves import range from six.moves import range
from user_tasks.models import UserTaskArtifact, UserTaskStatus from user_tasks.models import UserTaskArtifact, UserTaskStatus
from user_tasks.tasks import UserTask from user_tasks.tasks import UserTask
...@@ -630,6 +630,9 @@ def create_export_tarball(course_module, course_key, context, status=None): ...@@ -630,6 +630,9 @@ def create_export_tarball(course_module, course_key, context, status=None):
Updates the context with any error information if applicable. Updates the context with any error information if applicable.
""" """
name = course_module.url_name name = course_module.url_name
if isinstance(name, binary_type):
name = name.decode('utf-8')
export_file = NamedTemporaryFile(prefix=name + '.', suffix=".tar.gz") export_file = NamedTemporaryFile(prefix=name + '.', suffix=".tar.gz")
root_dir = path(mkdtemp()) root_dir = path(mkdtemp())
......
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