[f20-branch][PATCH] Encode possible unicode objects before calling str() on them

David Shea dshea at redhat.com
Tue Oct 22 13:22:37 UTC 2013


On 10/22/2013 08:57 AM, Vratislav Podzimek wrote:
> 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))
Ack.


More information about the anaconda-patches mailing list