From 773034515ce7e0b56bd18e32b4ac9ff25aa3e4c6 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sun, 6 Jun 2021 14:53:47 -0400 Subject: Changelog and docstring tweaks re #1846 --- paramiko/sftp_client.py | 8 ++++++-- sites/www/changelog.rst | 3 +++ 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 ` 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 `/`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. -- cgit v1.2.3