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

add missing file-like object methods #588

Merged
merged 3 commits into from Dec 18, 2015

Conversation

Projects
None yet
2 participants
@ameily
Contributor

ameily commented Sep 21, 2015

The Python io module requires that file-like objects implement a specific API. For paramiko, four methods were missing: readable(), writable(), seekable(), and readinto().

Test

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)
wrapper.seek(0)
data2 = wrapper.read(10)
add missing file-like object methods
Four methods were missing: readable(), writable(), seekable(), and
readinto().
@ameily

This comment has been minimized.

Contributor

ameily commented Dec 17, 2015

Is there anything I have to do on my end to get this PR merged?

@bitprophet bitprophet added this to the 1.17 milestone Dec 17, 2015

@bitprophet

This comment has been minimized.

Member

bitprophet commented Dec 17, 2015

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
Conflicts:
	paramiko/sftp_file.py
	sites/www/changelog.rst
@ameily

This comment has been minimized.

Contributor

ameily commented Dec 18, 2015

I merged upstream master

@bitprophet bitprophet merged commit 9a87a8e into paramiko:master Dec 18, 2015

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
@bitprophet

This comment has been minimized.

Member

bitprophet commented Dec 18, 2015

Thanks @ameily! Figured I'd review and merge while I was lookin :)

For the future, some notes, please:

  • Try not to include whitespace changes, they make the diff longer & pollute git-blame ;)
  • No need for :meth: in front of method name references, Sphinx's default role stuff tends to work as-is and it's our style to rely on that.
  • The changelog needs issue links & class/method links when possible - just refer to how nearby line-items do it for a reference.
@ameily

This comment has been minimized.

Contributor

ameily commented Dec 18, 2015

Awesome! Thanks for the heads up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment