Skip to content

Allow filecache append mode to create missing targets - #2251

Open
fhgffy wants to merge 1 commit into
fsspec:masterfrom
fhgffy:fix/filecache-append-new-file
Open

fhgffy wants to merge 1 commit into
fsspec:masterfrom
fhgffy:fix/filecache-append-new-file

Conversation

@fhgffy

@fhgffy fhgffy commented Oct 9, 2026

Copy link
Copy Markdown

Opening a missing target with filecache in append mode raises TypeError: cannot unpack non-iterable bool object instead of creating the file. WholeFileCacheFileSystem._open() allows a missing remote file through the append branch, then unconditionally unpacks the absent cache entry. simplecache already permits this operation.

Only unpack and validate cached metadata when an entry exists, allowing new append targets to reach the existing LocalTempFile creation path. Existing read/update and partially cached file handling is preserved.

The regression covers ab and a+b with memory and local targets, comparing filecache and simplecache. It checks creation, append position, update reads, upload on close, and a subsequent append.

Validation on Windows / Python 3.14.3:

  • Before the fix: 4 failed / 4 passed; all four failures are filecache missing-target opens.
  • New regressions plus existing append/update tests: 16 passed.
  • Complete cache module: 123 passed / 21 skipped.
  • Ruff 0.14.3 check and format check passed; git diff --check passed.
  • The complete project suite was attempted but not completed; some tests require optional services and dependencies. No full-suite pass is claimed.

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.

1 participant