From 7b2931f040d824a7d5973b704b2835b842384667 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Thu, 3 Dec 2015 18:28:40 +0100 Subject: Update sftp_client.py --- paramiko/sftp_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py index f8c77042..b953526c 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -693,10 +693,10 @@ class SFTPClient(BaseSFTP, ClosingContextManager): data = fr.read(32768) fl.write(data) size += len(data) - if callback is not None: - callback(size, file_size) if len(data) == 0: break + if callback is not None: + callback(size, file_size) return size def get(self, remotepath, localpath, callback=None): -- cgit v1.2.3