ZIP append mode fails when the target archive does not exist. The underlying file is always opened as r+b, which raises before zipfile.ZipFile(mode="a") can create the archive. This affects both local paths and memory URLs.
import fsspec
fs = fsspec.filesystem("zip", fo="memory://new.zip", mode="a")
# FileNotFoundError: /new.zip
Expected: create the archive, then allow entries to be written. This is the behavior of Python’s zipfile.ZipFile(..., mode="a"). Appending to an existing archive must preserve its existing entries.
Reproduced on current main, Python 3.12.12, macOS arm64. A regression using a tiny archive fails for both local and memory filesystems.
ZIP append mode fails when the target archive does not exist. The underlying file is always opened as
r+b, which raises beforezipfile.ZipFile(mode="a")can create the archive. This affects both local paths and memory URLs.Expected: create the archive, then allow entries to be written. This is the behavior of Python’s
zipfile.ZipFile(..., mode="a"). Appending to an existing archive must preserve its existing entries.Reproduced on current main, Python 3.12.12, macOS arm64. A regression using a tiny archive fails for both local and memory filesystems.