Fix local URL downloads to file-like objects - #2230
Open
sunlishuo25 wants to merge 1 commit into
Open
sunlishuo25 wants to merge 1 commit into
sunlishuo25 wants to merge 1 commit into
Conversation
sunlishuo25
marked this pull request as ready for review
October 5, 2026 07:59
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.
LocalFileSystem.get_file("file://…", buffer)raisesFileNotFoundErrorfor an existing source, while copying the same URL to a destination filename succeeds. Normalize the source before opening it in the file-like destination branch, so bothfile://andlocal://work with that destination type.This uses the existing local path handling for strings and
PathLike[str]. Raw bytes paths and integer file descriptors, previously accepted incidentally by the builtinopencall in this branch, no longer bypass that normalizer.Add regression coverage for both aliases, plain string/Path sources, empty/binary contents, and caller-owned output position and lifetime, plus a changelog entry.
Validation: the regression matrix had 4 failures before the fix and passes all 16 cases after it. Local/core/DirFileSystem suites: 420 passed, 27 skipped for optional dependencies/platform conditions. Additional caller/boundary checks: 19 passed. Ruff check/format and diff checks passed. Full cloud/Docker/FUSE/downstream suites and Windows/Linux execution were not run.
Developed with GPT assistance.