From 75eeee0f89e8af31fe566fc8229bcfc0458859df Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Thu, 19 Dec 2019 12:48:13 -0500 Subject: [PATCH] Correct the output file name for exports. --- cms/djangoapps/contentstore/tasks.py | 3 --- cms/djangoapps/contentstore/views/import_export.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/cms/djangoapps/contentstore/tasks.py b/cms/djangoapps/contentstore/tasks.py index 2e97557c1a..c04eef315d 100644 --- a/cms/djangoapps/contentstore/tasks.py +++ b/cms/djangoapps/contentstore/tasks.py @@ -630,9 +630,6 @@ def create_export_tarball(course_module, course_key, context, status=None): Updates the context with any error information if applicable. """ name = course_module.url_name - if isinstance(name, binary_type): - name = name.decode('utf-8') - export_file = NamedTemporaryFile(prefix=name + '.', suffix=".tar.gz") root_dir = path(mkdtemp()) diff --git a/cms/djangoapps/contentstore/views/import_export.py b/cms/djangoapps/contentstore/views/import_export.py index 3eb9946cd9..5f39f74b01 100644 --- a/cms/djangoapps/contentstore/views/import_export.py +++ b/cms/djangoapps/contentstore/views/import_export.py @@ -277,7 +277,7 @@ def send_tarball(tarball, size): """ wrapper = FileWrapper(tarball, settings.COURSE_EXPORT_DOWNLOAD_CHUNK_SIZE) response = StreamingHttpResponse(wrapper, content_type='application/x-tgz') - response['Content-Disposition'] = u'attachment; filename=%s' % os.path.basename(tarball.name.encode('utf-8')) + response['Content-Disposition'] = u'attachment; filename=%s' % os.path.basename(tarball.name) response['Content-Length'] = size return response