From 2cbe38308097f920cec0aa87fed85f2cfe6d9612 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Thu, 29 Nov 2012 16:16:35 -0800 Subject: [PATCH] Apply put() version of #90 --- 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 2184134..8cb8cea 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -567,12 +567,12 @@ class SFTPClient (BaseSFTP): try: while True: data = fl.read(32768) - if len(data) == 0: - break fr.write(data) size += len(data) if callback is not None: callback(size, file_size) + if len(data) == 0: + break finally: fr.close() if confirm and file_size: