diff options
author | Torkil Gustavsen <torkil@gmail.com> | 2015-07-23 13:22:39 +0200 |
---|---|---|
committer | Torkil Gustavsen <torkil@gmail.com> | 2015-07-23 13:22:39 +0200 |
commit | a671dafb8775e585086600a1fddd364def5aeb20 (patch) | |
tree | 976bae9c19d1ed195705c96e494f6adf5a5b02af /tests/test_sftp.py | |
parent | 9c77538747881bb8cb3f6c7b220515cfd6943b92 (diff) |
prefetch now requires file_size to be passed in as a parameter
Calling stat from inside the prefetch-body has led users to
receive IOError: The message [<filename>] is not extractable.
Diffstat (limited to 'tests/test_sftp.py')
-rwxr-xr-x | tests/test_sftp.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/test_sftp.py b/tests/test_sftp.py index cb8f7f84..55762c21 100755 --- a/tests/test_sftp.py +++ b/tests/test_sftp.py @@ -696,7 +696,8 @@ class SFTPTest (unittest.TestCase): f.readv([(0, 12)]) with sftp.open(FOLDER + '/zero', 'r') as f: - f.prefetch() + file_size = f.stat().st_size + f.prefetch(file_size) f.read(100) finally: sftp.unlink(FOLDER + '/zero') |