The Python io module requires that file-like objects implement a specific API. For paramiko, four methods were missing: readable(), writable(), seekable(), and readinto().
The following Python3 code can be run to test that this Pull Request implements the missing file-like object methods. An exception will be raised without this Pull Request applied. Here, s is an SSHClient instance.
sftp = s.open_sftp()
raw = sftp.open("/path/to/a/text/file.txt", "r")
wrapper = io.TextIOWrapper(raw, encoding='utf-8')
data = wrapper.read(10)
data2 = wrapper.read(10)
add missing file-like object methods
Four methods were missing: readable(), writable(), seekable(), and
add unit tests for file-like object methods and update changelog and …
Is there anything I have to do on my end to get this PR merged?
It looks like there's merge conflicts - keeping a PR branch up to date with master is definitely a good idea! (But you can ignore Travis status for now, there is a race condition it's triggering that needs fixing.)
I also notice I did not add to a milestone, just did so. Thanks for your patience!
Merge branch 'master' of github.com:paramiko/paramiko
I merged upstream master
Thanks @ameily! Figured I'd review and merge while I was lookin :)
For the future, some notes, please:
Awesome! Thanks for the heads up.