summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--paramiko/sftp_client.py8
-rw-r--r--sites/www/changelog.rst3
2 files changed, 9 insertions, 2 deletions
diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py
index 88e6eee0..6294fb48 100644
--- a/paramiko/sftp_client.py
+++ b/paramiko/sftp_client.py
@@ -772,10 +772,12 @@ class SFTPClient(BaseSFTP, ClosingContextManager):
optional callback function (form: ``func(int, int)``) that accepts
the bytes transferred so far and the total bytes to be transferred
:param bool prefetch:
- option to deactivate prefetching
+ controls whether prefetching is performed (default: True)
:return: the `number <int>` of bytes written to the opened file object
.. versionadded:: 1.10
+ .. versionchanged:: 2.8
+ Added the ``prefetch`` keyword argument.
"""
file_size = self.stat(remotepath).st_size
with self.open(remotepath, "rb") as fr:
@@ -797,11 +799,13 @@ class SFTPClient(BaseSFTP, ClosingContextManager):
optional callback function (form: ``func(int, int)``) that accepts
the bytes transferred so far and the total bytes to be transferred
:param bool prefetch:
- option to deactivate prefetching
+ controls whether prefetching is performed (default: True)
.. versionadded:: 1.4
.. versionchanged:: 1.7.4
Added the ``callback`` param
+ .. versionchanged:: 2.8
+ Added the ``prefetch`` keyword argument.
"""
with open(localpath, "wb") as fl:
size = self.getfo(remotepath, fl, callback, prefetch)
diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst
index f3ff0749..7f70c232 100644
--- a/sites/www/changelog.rst
+++ b/sites/www/changelog.rst
@@ -2,6 +2,9 @@
Changelog
=========
+- :feature:`1846` Add a ``prefetch`` keyword argument to `SFTPClient.get <paramiko.sftp_client.SFTPClient.get>`/`SFTPClient.getfo <paramiko.sftp_client.SFTPClient.getfo>`
+ so users who need to skip SFTP prefetching are able to conditionally turn it
+ off. Thanks to Github user ``@h3ll0r`` for the PR.
- :release:`2.7.2 <2020-08-30>`
- :support:`- backported` Update our CI to catch issues with sdist generation,
installation and testing.