From 251b4bac40bd12ca6de65b417301c302df19301f Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Sun, 5 May 2019 18:32:52 -0400 Subject: [PATCH] Do a copy,delete instead of a rename os.rename doesn't work across multiple filesystems. Signed-off-by: Roberto Rosario --- mayan/apps/dependencies/classes.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mayan/apps/dependencies/classes.py b/mayan/apps/dependencies/classes.py index a70004bac8..f9124ad9dd 100644 --- a/mayan/apps/dependencies/classes.py +++ b/mayan/apps/dependencies/classes.py @@ -433,9 +433,14 @@ class JavaScriptDependency(Dependency): # Copy the content under the dependency's extracted content folder # 'package' to the final location. - Path(temporary_directory, 'package').rename( - target=force_text(path_install) + # We do a copy and delete instead of move because os.rename doesn't + # support renames across filesystems. + path_uncompressed_package = Path(temporary_directory, 'package') + shutil.rmtree(force_text(path_install)) + shutil.copytree( + force_text(path_uncompressed_package), force_text(path_install) ) + shutil.rmtree(force_text(path_uncompressed_package)) # Clean up temporary directory used for download shutil.rmtree(path=temporary_directory, ignore_errors=True)