From f403d8b99df130f36ae94c5224f9c26ff1ca81f3 Mon Sep 17 00:00:00 2001 From: Stijn Peeters Date: Wed, 13 Nov 2024 11:18:48 +0100 Subject: [PATCH] Always unlink zip file after handling --- backend/workers/manage_extension.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/workers/manage_extension.py b/backend/workers/manage_extension.py index 323aed7e..7a605c12 100644 --- a/backend/workers/manage_extension.py +++ b/backend/workers/manage_extension.py @@ -190,9 +190,10 @@ def unpack_from_zip(self, archive_path): with zipfile.ZipFile(archive_path, "r") as archive_file: archive_file.extractall(temp_name) except Exception as e: - archive_path.unlink() return self.extension_log.error(f"Could not extract extension zip archive {archive_path.name}: {e}. Cannot " f"install."), None + finally: + archive_path.unlink() return temp_name, extension_name