From 6ad235f5dba38fc153ea48ec836f8182404695fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s=20Rocha?= Date: Wed, 29 Oct 2014 14:17:27 -0400 Subject: [PATCH] Ignore errors during cleanup of course export command. --- .../courseware/management/commands/export_course.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/courseware/management/commands/export_course.py b/lms/djangoapps/courseware/management/commands/export_course.py index b5387db378..836c4e0f6f 100644 --- a/lms/djangoapps/courseware/management/commands/export_course.py +++ b/lms/djangoapps/courseware/management/commands/export_course.py @@ -72,7 +72,7 @@ def export_course_to_tarfile(course_key, filename): course_dir = export_course_to_directory(course_key, tmp_dir) compress_directory(course_dir, filename) finally: - shutil.rmtree(tmp_dir) + shutil.rmtree(tmp_dir, ignore_errors=True) def export_course_to_directory(course_key, root_dir): @@ -83,7 +83,7 @@ def export_course_to_directory(course_key, root_dir): raise CommandError("Invalid course_id") # The safest characters are A-Z, a-z, 0-9, , and . - # We represent the first four with \w. + # We represent the first four with \w. # TODO: Once we support courses with unicode characters, we will need to revisit this. replacement_char = u'-' course_dir = replacement_char.join([course.id.org, course.id.course, course.id.run])