From 8819ec05755d9ca79fea763da1eb8e2a969234ec Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Mon, 12 Mar 2012 20:27:59 +0100 Subject: [PATCH] Escape spaces in paths in legacy mode 'add' command. This also makes backslashes unsupported(but you're a bad person for having them in paths anyway) --- deluge/ui/console/commands/add.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deluge/ui/console/commands/add.py b/deluge/ui/console/commands/add.py index 0f8b281d6..701566ce7 100644 --- a/deluge/ui/console/commands/add.py +++ b/deluge/ui/console/commands/add.py @@ -99,6 +99,7 @@ class Command(BaseCommand): return defer.DeferredList(deferreds) def complete(self, line): + line = line.replace("\ ", " ") line = os.path.abspath(os.path.expanduser(line)) ret = [] if os.path.exists(line): @@ -132,5 +133,6 @@ class Command(BaseCommand): if os.path.isdir(p): p += "/" ret.append(p) - + for i in range(0, len(ret)): + ret[i] = ret[i].replace(" ", r"\ ") return ret