From 31bb3d9092202d6803f5be985b9e15f17ac84d04 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Sat, 12 Dec 2020 20:14:56 -0600 Subject: [PATCH] options: add parse_bytes Signed-off-by: Rob Browning --- lib/bup/options.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/bup/options.py b/lib/bup/options.py index 83159eb..6f1f162 100644 --- a/lib/bup/options.py +++ b/lib/bup/options.py @@ -285,3 +285,8 @@ class Options: v = _intify(v) opt[k] = _invert(v, invert) return (opt,flags,extra) + + def parse_bytes(self, args): + if sys.version_info[0] > 2: + args = [x.decode(errors='surrogateescape') for x in args] + return self.parse(args) -- 2.39.2