From 266127bb69da3437732d81113da383af85753e61 Mon Sep 17 00:00:00 2001 From: Dan39 Date: Thu, 19 Apr 2012 15:52:44 +0100 Subject: [PATCH] Fix #2065 : Console crash with missing closing quote --- deluge/ui/console/modes/legacy.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deluge/ui/console/modes/legacy.py b/deluge/ui/console/modes/legacy.py index 144cfa019..d7f005415 100644 --- a/deluge/ui/console/modes/legacy.py +++ b/deluge/ui/console/modes/legacy.py @@ -418,7 +418,12 @@ class Legacy(BaseMode): except KeyError: self.write("{!error!}Unknown command: %s" % cmd) return - args = self.console._commands[cmd].split(line) + + try: + args = self._commands[cmd].split(line) + except ValueError, e: + self.write("{!error!}Error parsing command: %s" % e) + return # Do a little hack here to print 'command --help' properly parser._print_help = parser.print_help