Skip to content

Create missing ZIP archives in append mode - #2139

Open
pentaoa wants to merge 1 commit into
fsspec:masterfrom
pentaoa:fix/zip-append-create
Open

Create missing ZIP archives in append mode#2139
pentaoa wants to merge 1 commit into
fsspec:masterfrom
pentaoa:fix/zip-append-create

Conversation

@pentaoa

@pentaoa pentaoa commented Sep 13, 2026

Copy link
Copy Markdown

Fixes #2138.

Opening ZipFileSystem(fo="memory://new.zip", mode="a") currently raises FileNotFoundError: the underlying r+b open fails before ZipFile can create the archive. Retry a missing OpenFile in w+b mode, while preserving the existing r+b path for archives that already exist. Other open failures still propagate.

The regression tests create an archive in append mode, reopen it to append a second entry, and check both entries’ contents on local and memory filesystems. Both cases fail before the fix. The ZIP and archive suites pass with 131 passed, 19 skipped (optional backends unavailable); Ruff and formatting checks pass. Includes a changelog entry.

Prepared with OpenAI Codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ZIP append mode cannot create a missing archive

1 participant