test(backup): cover failed zip member cleanup

(cherry picked from commit 857b969c57cd1c7f50b4d5c3d41800e2bc24e4d0)
This commit is contained in:
JoaoMarcos44
2026-09-26 21:14:49 -03:00
committed by kshitij
parent da1bc7d502
commit a71ff10071
2 changed files with 82 additions and 0 deletions

View File

@@ -468,6 +468,7 @@ def _write_zip_file(zf: zipfile.ZipFile, path: Path, arcname: str) -> None:
_discard_failed_zip_members(zf, filelist_len)
raise
def _zip_sqlite_snapshot(zf: zipfile.ZipFile, abs_path: Path, rel_path: Path, out_path: Path) -> Optional[int]:
"""Add a WAL-safe snapshot of *abs_path* to *zf*; return its byte size, or None on failure.