aboutsummaryrefslogtreecommitdiff
path: root/paramiko/sftp_client.py
diff options
context:
space:
mode:
authorJeremy T. Bouse <jbouse@debian.org>2014-08-28 22:23:08 -0700
committerJeremy T. Bouse <jbouse@debian.org>2014-08-28 22:23:08 -0700
commit87432e7ba4c5605f96ebf90de68b5a1d39193004 (patch)
treeda54f2772c9eb6615e9702b5fdee058333fb8d44 /paramiko/sftp_client.py
parente93504a2d0a549833b9fa4f4046dfe2396467de9 (diff)
parent588a4823436454e8968ee36ae95ff92e1cddc3f7 (diff)
downloadpython-paramiko-87432e7ba4c5605f96ebf90de68b5a1d39193004.tar
python-paramiko-87432e7ba4c5605f96ebf90de68b5a1d39193004.tar.gz
Merge tag 'upstream/1.14.1'
Upstream version 1.14.1
Diffstat (limited to 'paramiko/sftp_client.py')
-rw-r--r--paramiko/sftp_client.py14
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