Skip to content

Commit

Permalink
Fix writing to zipfiles on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
bpepple committed Feb 29, 2024
1 parent ca0fd91 commit c6acac5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion darkseid/archivers/zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c6acac5

Please sign in to comment.