[Yum-devel] [PATCH] Fix a corner case in exception2msg(). BZ 749239.

Zdeněk Pavlas zpavlas at redhat.com
Mon Oct 31 09:01:40 UTC 2011


Under some locales, python creates UTF8 encoded non-unicode
exceptions.  For such, exception2msg() returns values that
fail to convert to unicode.
---
 yum/i18n.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/yum/i18n.py b/yum/i18n.py
index 85ad15e..76a258d 100755
--- a/yum/i18n.py
+++ b/yum/i18n.py
@@ -484,7 +484,7 @@ def exception2msg(e):
         pass
 
     try:
-        return str(e)
+        return to_unicode(str(e))
     except:
         pass
     return "<exception failed to convert to text>"
-- 
1.7.4.4



More information about the Yum-devel mailing list