[Kimchi-devel] [PATCH] issue #330: Make sure exception argument is a string to convert it to unicode
Aline Manera
alinefm at linux.vnet.ibm.com
Thu Mar 6 18:14:28 UTC 2014
From: Aline Manera <alinefm at br.ibm.com>
The unicode() operation is only available for strings.
So make sure the exception argument is a string before converting it to
unicode.
Signed-off-by: Aline Manera <alinefm at br.ibm.com>
---
src/kimchi/exception.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kimchi/exception.py b/src/kimchi/exception.py
index 71a4d11..74134be 100644
--- a/src/kimchi/exception.py
+++ b/src/kimchi/exception.py
@@ -51,7 +51,7 @@ class KimchiException(Exception):
for key, value in args.iteritems():
if not isinstance(value, unicode):
- args[key] = unicode(value, 'utf-8')
+ args[key] = unicode(str(value), 'utf-8')
return unicode(translation.gettext(text), 'utf-8') % args
--
1.7.10.4
More information about the Kimchi-devel
mailing list