Repository navigation
Conversation
Windows raises PermissionError when it opens a directory as a file, so LocalStore.get, get_sync and get_partial_values raised instead of returning None. A shared reader now treats PermissionError as a missing key only when the path is a directory, so real permission errors still raise. get_partial_values also returns None for missing keys, as the Store ABC documents. Drop local and latency-local from the Windows-only PermissionError entry in the conformance ledger; fsspec-local stays. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
On Windows,
LocalStore.get,get_syncandget_partial_valuesnow returnNonefor a name that is a directory, as they already do on Linux and macOS, instead of raisingPermissionError. APermissionErroron a file still raises, andget_partial_valuesnow returnsNonefor a missing key, as theStoreinterface documents.Summary
src/zarr/storage/_local.py: a new_get_or_nonehelper returnsNoneonFileNotFoundError,IsADirectoryErrorandNotADirectoryError. It also returnsNoneonPermissionError, but only whenpath.is_dir(); otherwise it re-raises.get,get_syncandget_partial_valuesall call it. Before this,get_partial_valuescaught nothing, so a missing key raisedFileNotFoundError. It now returnsNone, which matches theStore.get_partial_valuesdocstring andMemoryStore.getsizeis unchanged.stat()on a directory succeeds on Windows too, so it never raisesPermissionError. A separate ledger entry already records that it returns a number for a directory on every OS.tests/test_store/test_stateful_conformance.py:localandlatency-localare removed from the Windows-only entry "get() on a directory raises PermissionError".fsspec-localstays, because this fix doesn't touch fsspec.test_divergence_ledger_is_exactwill fail on Windows if the entry is still needed, or if it is now wrong.Tests
test_read_returns_none_for_a_name_without_a_fileruns on every OS and skips nothing. It writesd/k, then readsd,missingandd/k/belowthrough each ofget,get_syncandget_partial_values, and expectsNoneevery time. Thewindows-errorcases replace_getwith a version that raisesPermissionErrorfor a directory, as Windows does, so the new branch also runs on Linux and macOS. When the agent removed theis_dir()check, exactly those three cases failed.test_read_raises_permission_error_for_a_filechecks that aPermissionErroron a real file still reaches the caller.test_filesystem_calls_are_observednow expects_get_or_noneas the off-loop helper forgetandget_partial_values.tests/test_store/passed, and so didpytest tests -k "local or partial or shard". Pre-commit (ruff, mypy, numpydoc) also passed.open()on a directory raisesPermissionErrorand that the ledger entry forlocal/latency-localis gone. CI is started withworkflow_dispatchon this branch, because theTestworkflow only runs on pull requests intomain.Stack
Stacked on
test/store-contract(zarr-developers#4646), which adds the conformance state machine and the ledger entry this PR shrinks. Merge zarr-developers#4646 first, then retarget this PR tomain.🤖 Generated with Claude Code