Repository navigation
fix: support bytes paths in native filesystem operations #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bc250f2
fix: support bytes paths in native operations
kushaldave002 73a99ad
refactor: run cp and md5sum on the server for bytes paths
shcheklein 91158b1
docs: drop the bytes-path paragraph from the README
shcheklein 3c02c55
fix: skip makedirs for the root and pass -- to shell commands
shcheklein 0ea6eda
refactor: move the parent and "--" fixes out to #91 and #92
shcheklein cc78957
refactor: simplify the command helper and split the bytes tests
shcheklein 0ed29b7
Merge main into fix-byte-path-operations
shcheklein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[AI-generated — Copilot] Logic / simplification / alternatives:
asyncsshbehavior &ProcessError.commandtype:SSHClientConnection.create_session/SSHClientChannel.createtypecommandasOptional[str]; passingbytesworks today becauseasyncssh.packet.Stringacceptsbytes. Buildingbytesforstrpaths too also changesProcessError.commandfromstrtobytesforstrcallers. That's a reasonable trade-off for a single code path, though only encoding tobyteswhen a path isbyteswould keepstrcallers on the documentedstrpath.b"cp",b"md5sum",b"md5") and buildingb" ".join((command, *map(_quote, paths)))(or(command, b"--", *map(_quote, paths))with fix: prefix paths starting with - with ./ in cp, md5sum and md5 #92) avoids%sformat strings and centralizes--in one place.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in cc78957:
_execute_with_paths(program, *paths)joins the quoted paths to the program.I kept bytes commands for str paths too, so there's one code path. asyncssh's
String()accepts bytes, and everycp_fileandchecksumtest sends one, so CI would catch an asyncssh change.ProcessError.commanddoes become bytes, but it isn't part of the fsspec API.#92 now uses a
./prefix inside a_quotehelper instead of--, because--doesn't help with a bare-. Whichever PR merges second folds it into this_quote.