From 46e51811e820b1d85e0fce2d50eb8bdae3d7c90c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 17 Nov 2021 14:34:14 +0530 Subject: [PATCH] Dont rise an exception in patchfile close() This allows partial transfers, by overwriting the dest file with the tempfile even if the transfer was not completed --- kittens/transfer/librsync.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kittens/transfer/librsync.py b/kittens/transfer/librsync.py index eb96fc07d..7b42adba2 100644 --- a/kittens/transfer/librsync.py +++ b/kittens/transfer/librsync.py @@ -133,11 +133,9 @@ class PatchFile(StreamingJob): self.get_remaining_output() self.src_file.close() count = 100 - while not self.finished: + while not self.finished and count > 0: self() count -= 1 - if count == 0: - raise Exception('Patching file did not receive enough input') self.dest_file.close() if self.overwrite_src: os.replace(self.dest_file.name, self.src_file.name)