diff options
author | Jeremy T. Bouse <jbouse@debian.org> | 2014-08-28 22:23:07 -0700 |
---|---|---|
committer | Jeremy T. Bouse <jbouse@debian.org> | 2014-08-28 22:23:07 -0700 |
commit | 588a4823436454e8968ee36ae95ff92e1cddc3f7 (patch) | |
tree | e4a22fe9360117ca8d4d85d9628d7581a57ac97c /paramiko/sftp_client.py | |
parent | 4e426087436d01fe00a120e5e7ce7a5e0a1e0970 (diff) | |
download | python-paramiko-588a4823436454e8968ee36ae95ff92e1cddc3f7.tar python-paramiko-588a4823436454e8968ee36ae95ff92e1cddc3f7.tar.gz |
Imported Upstream version 1.14.1upstream/1.14.1
Diffstat (limited to 'paramiko/sftp_client.py')
-rw-r--r-- | paramiko/sftp_client.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py index 1caaf16..99a29e3 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -534,9 +534,7 @@ class SFTPClient(BaseSFTP): an `.SFTPAttributes` object containing attributes about the given file. - .. versionadded:: 1.4 - .. versionchanged:: 1.7.4 - Began returning rich attribute objects. + .. versionadded:: 1.10 """ with self.file(remotepath, 'wb') as fr: fr.set_pipelined(True) @@ -566,7 +564,9 @@ class SFTPClient(BaseSFTP): The SFTP operations use pipelining for speed. :param str localpath: the local file to copy - :param str remotepath: the destination path on the SFTP server + :param str remotepath: the destination path on the SFTP server. Note + that the filename should be included. Only specifying a directory + may result in an error. :param callable callback: optional callback function (form: ``func(int, int)``) that accepts the bytes transferred so far and the total bytes to be transferred @@ -584,7 +584,7 @@ class SFTPClient(BaseSFTP): """ file_size = os.stat(localpath).st_size with open(localpath, 'rb') as fl: - return self.putfo(fl, remotepath, os.stat(localpath).st_size, callback, confirm) + return self.putfo(fl, remotepath, file_size, callback, confirm) def getfo(self, remotepath, fl, callback=None): """ @@ -601,9 +601,7 @@ class SFTPClient(BaseSFTP): the bytes transferred so far and the total bytes to be transferred :return: the `number <int>` of bytes written to the opened file object - .. versionadded:: 1.4 - .. versionchanged:: 1.7.4 - Added the ``callable`` param. + .. versionadded:: 1.10 """ with self.open(remotepath, 'rb') as fr: file_size = self.stat(remotepath).st_size |