Treat local path objects as paths while retaining IO behavior - #85
Open
OskarEichler wants to merge 1 commit into
Open
Treat local path objects as paths while retaining IO behavior#85OskarEichler wants to merge 1 commit into
OskarEichler wants to merge 1 commit into
Conversation
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.
Summary
Normalize local path-protocol objects before selecting the upload/download IO path. Keep real File/IO objects as streams, including their current positions and caller ownership.
Reproduction and evidence
Closes #29. With a Pathname source, a six-byte upload in three-byte chunks repeatedly rereads the first chunk and never completes; a bounded 30-transition simulation reproduces it. A Pathname destination receiving
abc, thendef, retains onlydefbecause Pathname#write reopens the file. Both public-entrypoint simulations pass after this patch. Combined release integration also transfers binary files both ways through local/usr/bin/scpprocesses.Compatibility / breaking changes
No version/dependency change. Objects implementing to_path but not to_io are treated as paths. File/IO objects with to_io retain streaming behavior. Custom objects that deliberately implemented both to_path and read/write without to_io will now be treated as paths.
Verification and limits