Repository navigation
Conversation
PDGGK
force-pushed
the
fix/local-file-capabilities
branch
from
October 3, 2026 06:51
75f9a14 to
6780e44
Compare
PDGGK
marked this pull request as ready for review
October 3, 2026 06:52
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.
Problem
A local text update opened through
fsspec.open(path, "r+", encoding="utf-8")can raiseio.UnsupportedOperation: not writable, although the underlyingr+bfile supports writes. Thefilesystem("file").openroute has the same result. Write-only local streams also reportreadable=True.The capability methods introduced in #589 use mode-string heuristics.
TextIOWrapperrelies on those reported capabilities, so an incorrect result prevents otherwise supported updates.Change
Delegate
LocalFileOpener.readable()andwritable()to the underlying file object, as the other I/O operations already do. Add capability, public text-update, closed-handle, pickle and compression regression tests, plus a changelog entry.The change is limited to these two capability expressions. It does not change mode parsing, stream ownership, transactions or remote filesystems, or add support for compressed update modes.
Validation
Tested locally on Linux with Python 3.12.14 only:
open, pickle, closing behavior, and gzip/bz2/xz.The skips include unavailable optional dependencies and Windows-specific checks. The full upstream Python/OS matrix, remote integrations and downstream CI were not run locally. A multiprocessing/fork deprecation warning remains in the tested suite.