From 37c1b045a01efa8ddf9345569fe824f167bf48e4 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 14 Jan 2020 16:18:18 +0100 Subject: [PATCH] get/init: consistently use argv_bytes() for RemoteRepo/Client We should be using argv_bytes() here, since the parsing will require using bytes later. Signed-off-by: Johannes Berg --- cmd/get-cmd.py | 2 ++ cmd/init-cmd.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/get-cmd.py b/cmd/get-cmd.py index c2fc547..a02f270 100755 --- a/cmd/get-cmd.py +++ b/cmd/get-cmd.py @@ -578,6 +578,8 @@ def main(): client.bwlimit = parse_num(opt.bwlimit) if is_reverse and opt.remote: misuse("don't use -r in reverse mode; it's automatic") + if opt.remote: + opt.remote = argv_bytes(opt.remote) if opt.remote or is_reverse: dest_repo = RemoteRepo(opt.remote) else: diff --git a/cmd/init-cmd.py b/cmd/init-cmd.py index 412ecec..ad2ed82 100755 --- a/cmd/init-cmd.py +++ b/cmd/init-cmd.py @@ -10,6 +10,7 @@ import sys from bup import git, options, client from bup.helpers import log, saved_errors +from bup.compat import argv_bytes optspec = """ @@ -32,5 +33,5 @@ except git.GitError as e: if opt.remote: git.check_repo_or_die() - cli = client.Client(opt.remote, create=True) + cli = client.Client(argv_bytes(opt.remote), create=True) cli.close() -- 2.39.2