From 799cf27c5d3cb164a30803798a5bd3fb4bf7a1e9 Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 3 Sep 2022 19:59:59 +0200 Subject: [PATCH] restore .bin-suffix for nameless PUT/POSTs disappeared in v1.0.11 --- copyparty/httpcli.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 69595f2c..e385c037 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -778,6 +778,10 @@ class HttpCli(object): self.log("fallthrough? thats a bug", 1) suffix = "-{:.6f}-{}".format(time.time(), self.dip) + if not fn: + suffix += ".bin" + fn = "put" + suffix + params = {"suffix": suffix, "fdir": fdir} if self.args.nw: params = {} @@ -785,9 +789,6 @@ class HttpCli(object): params.update(open_ka) - if not fn: - fn = "put" + suffix - with ren_open(fn, *open_a, **params) as zfw: f, fn = zfw["orz"] path = os.path.join(fdir, fn)