From 8067acbf82aeffdcd2d9daa56526133ad0ae2b7c Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sat, 27 Feb 2016 17:20:43 -0800 Subject: [PATCH] cmd_receive: close the file before renaming I'm always forgetting this one. It's more obvious on windows. --- src/wormhole/scripts/cmd_receive_blocking.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wormhole/scripts/cmd_receive_blocking.py b/src/wormhole/scripts/cmd_receive_blocking.py index 7987578..9c883c2 100644 --- a/src/wormhole/scripts/cmd_receive_blocking.py +++ b/src/wormhole/scripts/cmd_receive_blocking.py @@ -153,6 +153,7 @@ def receive_blocking(args): assert received == xfersize if mode == "file": + f.close() os.rename(tmp_destname, abs_destname) print(u"Received file written to %s" % destname, file=args.stdout) else: @@ -164,6 +165,7 @@ def receive_blocking(args): # "../tmp/oops" both do the same thing as the (safe) # "tmp/oops". print(u"Received files written to %s/" % destname, file=args.stdout) + f.close() record_pipe.send_record(b"ok\n") record_pipe.close()