diff --git a/darkseid/archivers/zip.py b/darkseid/archivers/zip.py index 3bce7a2..eee5df4 100644 --- a/darkseid/archivers/zip.py +++ b/darkseid/archivers/zip.py @@ -94,7 +94,8 @@ def _rebuild(self: "ZipArchiver", exclude_list: list[str]) -> bool: zout.writestr(item, buffer) # replace with the new file - self.path.unlink() + self.path.unlink(missing_ok=True) + zout.close() # Required on Windows shutil.move(cast(str, zout.filename), self.path) return True except (zipfile.BadZipfile, OSError) as e: