[f20-branch][PATCH] Encode possible unicode objects before calling str() on them
Vratislav Podzimek
vpodzime at redhat.com
Tue Oct 22 12:57:30 UTC 2013
Otherwise the default ascii codec is used and traceback appears.
Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
pyanaconda/ui/gui/utils.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pyanaconda/ui/gui/utils.py b/pyanaconda/ui/gui/utils.py
index 5e5095c..75445ca 100644
--- a/pyanaconda/ui/gui/utils.py
+++ b/pyanaconda/ui/gui/utils.py
@@ -231,4 +231,7 @@ def escape_markup(value):
This function converts the value to a string before passing markup_escape_text().
"""
+ if isinstance(value, unicode):
+ value = value.encode("utf-8")
+
return GLib.markup_escape_text(str(value))
--
1.7.11.7
More information about the anaconda-patches
mailing list