SFTP reads are supposed to be binary, so don't wrap with str() #15
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.
Discovered this as I was porting a project over to py3k. My tests had some round-trippers that were ending up as
b"b'foobar'", which would fail my unit test. This happens in py3k when casting a bytes object into a string. Since paramiko does everything as bytes in py3k (as per the SFTP specs), this would result in bad results being read back in a round-trip scenario.The existing tests didn't notice this because any tests that wrote to the content provider never read it back, and any tests that read stuff back only read back entries in the existing content provider fixture. which were are already string objects. I added a round-trip test that fails without this change and passes with it.