From 5fffdd00da651f9eb4e52dbbd4e8da196b50ca5a Mon Sep 17 00:00:00 2001 From: MaxTheBreaker Date: Mon, 21 Sep 2020 07:03:12 +0300 Subject: [PATCH] Fix permission denied in download function Fixes issue #18 caused by trying to move the temporary file that is still open --- src/mega/mega.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mega/mega.py b/src/mega/mega.py index 906b0db..7a51f5e 100644 --- a/src/mega/mega.py +++ b/src/mega/mega.py @@ -741,9 +741,9 @@ def _download_file(self, if (file_mac[0] ^ file_mac[1], file_mac[2] ^ file_mac[3]) != meta_mac: raise ValueError('Mismatched mac') - output_path = Path(dest_path + file_name) - shutil.move(temp_output_file.name, output_path) - return output_path + output_path = Path(dest_path + file_name) + shutil.move(temp_output_file.name, output_path) + return output_path def upload(self, filename, dest=None, dest_filename=None): # determine storage node