Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Changes
* Added `ssh2.session.Session.flag` function for enabling/disabling session flags like compression support.
* Added `ssh2.session.userauth_keyboardinteractive_callback` for authentication using Python callback function,
for example for Oauth and other two-factor (2FA) or more factor authentication. Thanks @MattCatz .
* `ssh2.sftp_handle.SFTPHandle.closed` is now a public property indicating whether `ssh2.sftp_handle.SFTPHandle.close`
was called on a `SFTPHandle` or not.


1.1.2
Expand Down
5 changes: 5 additions & 0 deletions ci/integration_tests/test_sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ def test_sftp_read(self):
remote_data = b""
for rc, data in remote_fh:
remote_data += data
self.assertFalse(remote_fh.closed)
self.assertEqual(remote_fh.close(), 0)
self.assertTrue(remote_fh.closed)
self.assertEqual(remote_data, test_file_data)
finally:
os.unlink(remote_filename)
self.assertTrue(remote_fh.closed)

def test_sftp_write(self):
self.assertEqual(self._auth(), 0)
Expand All @@ -65,6 +68,8 @@ def test_sftp_write(self):
LIBSSH2_FXF_CREAT | LIBSSH2_FXF_WRITE,
mode) as remote_fh:
remote_fh.write(data)
self.assertFalse(remote_fh.closed)
self.assertTrue(remote_fh.closed)
with open(remote_filename, 'rb') as fh:
written_data = fh.read()
_stat = os.stat(remote_filename)
Expand Down
2 changes: 1 addition & 1 deletion ssh2/sftp.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading