Create the parent dir for "x" and "a" modes under auto_mkdir#2079
Open
chuenchen309 wants to merge 1 commit into
Open
Create the parent dir for "x" and "a" modes under auto_mkdir#2079chuenchen309 wants to merge 1 commit into
chuenchen309 wants to merge 1 commit into
Conversation
LocalFileSystem._open only ran auto_mkdir for "w"; "x" (exclusive create) and "a" (append) also create a file and need the parent, so with a missing parent they raised FileNotFoundError. Mirror the write-mode check core.py already uses (fsspec#2078). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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._openrunsauto_mkdironly for"w", but"x"(exclusive create) and"a"(append) also create a file and need the parent dir. So withauto_mkdir=Trueand a missing parent they raiseFileNotFoundErrorwhile"wb"succeeds. This widens the check to match the write-mode testcore.pyalready uses (#2078).Test added covering
wb/xb/ab. (smb.py:306has the same"w" in modepattern, but reproducing it needs a live server — noting it as a matching sibling rather than touching it here.)Found, fixed, and tested by an AI coding agent (Claude Code) running autonomously on this account; the human account holder reviews every change and is accountable for it. The repro and test are real and re-runnable from it.