From 1dde6f6debb8c9b21e63b40d5bea81b5217d2461 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Thu, 2 Dec 2021 18:51:06 -0800 Subject: [PATCH] Add temp file to cleanup list just once when its first created --- cli/onionshare_cli/web/send_base_mode.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/onionshare_cli/web/send_base_mode.py b/cli/onionshare_cli/web/send_base_mode.py index d786b8b5..d0fccf06 100644 --- a/cli/onionshare_cli/web/send_base_mode.py +++ b/cli/onionshare_cli/web/send_base_mode.py @@ -200,11 +200,11 @@ class SendBaseModeWeb: self._gzip_compress(filesystem_path, gzip_file.name, 6, None) self.gzip_individual_files[filesystem_path] = gzip_file.name + # Cleanup this temp file + self.web.cleanup_tempfiles.append(gzip_file) + file_to_download = self.gzip_individual_files[filesystem_path] filesize = os.path.getsize(self.gzip_individual_files[filesystem_path]) - - # Cleanup this temp file - self.web.cleanup_tempfiles.append(gzip_file) else: file_to_download = filesystem_path filesize = os.path.getsize(filesystem_path)