Repository navigation
fix(storage): accept paths in a file store located in the working directory on fsspec before 2024 - #1686
Merged
Conversation
fsspec before 2024 leaves "." segments in a resolved path, so a store whose location is "" or "." rejected every path, including ones inside it. Compare normalized paths instead. The working-directory test now checks what the store does with each path: it is rejected, or fsspec resolves it inside the store and I/O stays there. Old fsspec does not read some "file:" and "local:" forms as a protocol, so it accepts them as names inside the store. The Windows download test accepts OSError, which Windows raises for a source path containing ":".
dimitri-yatsenko
requested review from
MilagrosMarin,
kavenk,
lum-agilyti and
ttngu207
November 18, 2026 16:39
MilagrosMarin
approved these changes
Nov 20, 2026
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.
masterCI fails in two jobs since the last merges. This fixes both.Minimum dependency versions. fsspec before 2024 leaves
.segments in a resolved local path. A file store whoselocationis""or"."therefore rejected every path, including paths inside it (data/inside.txt). The location check inStorageBackend._full_pathnow compares normalized paths (posixpath.normpathon both sides). Stores with any other location were not affected.The working-directory test in
test_path_confinement.pyasserted thatfile:andlocal:paths are rejected. That holds on current fsspec only: fsspec 2023 does not read some of these forms as a protocol and resolves them to names inside the working directory. The test now checks what the store does with each path: either it is rejected, or it resolves inside the store, and a write and read through it leave the file outside the store unchanged.Windows unit tests.
test_download_into_directory_uses_last_component_only[drive]expectedFileNotFoundErrorfor a missing source file. Windows raisesOSError(Errno 22) for a source path containing:, so the test now acceptsOSError, of whichFileNotFoundErroris a subclass.The same change is on
maint/2.3(de9d28a).Tested locally: the full unit suite with current dependencies and with the CI minimum pins (fsspec 2023.1.0), and the attach, object and hash-storage integration tests on MySQL and PostgreSQL. Windows runs in CI here.