summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2021-06-06 14:53:47 -0400
committerJeff Forcier <jeff@bitprophet.org>2021-06-06 14:53:47 -0400
commit773034515ce7e0b56bd18e32b4ac9ff25aa3e4c6 (patch)
treecc12971f3adca3f7652b672f8306a0caa2a37bc0
parent85a8203bb8b0dcde859a75bbd6500f30b34b95d5 (diff)
Changelog and docstring tweaks re #1846
-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.