From 1e2fba9680249164e32f087e6f0f6860c265c8ba Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 25 Nov 2009 22:02:22 +0000 Subject: [PATCH] Small bugfix to cmdhandler to avoid a unicode-related traceback. . Griatch --- src/cmdhandler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmdhandler.py b/src/cmdhandler.py index 92da51a967..647e707367 100755 --- a/src/cmdhandler.py +++ b/src/cmdhandler.py @@ -137,7 +137,9 @@ class Command(object): """ # If we get a unicode string with un-recognizable characters, replace # them instead of throwing errors. - self.raw_input = unicode(raw_input, errors='replace') + self.raw_input = raw_input + if not isinstance(raw_input, unicode): + self.raw_input = unicode(raw_input, errors='replace') self.source_object = source_object self.session = session # The work starts here.