[master/rhel7-branch] Don't try to unicode unicode strings (#1023052)

David Shea dshea at redhat.com
Mon Nov 11 16:38:26 UTC 2013


On 11/11/2013 11:31 AM, Vratislav Podzimek wrote:
> Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> ---
>   pyanaconda/ui/tui/simpleline/base.py | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/pyanaconda/ui/tui/simpleline/base.py
> b/pyanaconda/ui/tui/simpleline/base.py
> index a2b9c4e..0801b7a 100644
> --- a/pyanaconda/ui/tui/simpleline/base.py
> +++ b/pyanaconda/ui/tui/simpleline/base.py
> @@ -773,11 +773,12 @@ class Widget(object):
>           if not text:
>               return
> ·
> -        try:
> -            text = text.decode("utf-8")
> -        except UnicodeDecodeError as e:
> -            raise ValueError("Unable to decode string %s" %
> -                    str(e.object).decode("utf-8", "replace"))
> +        if isinstance(text, str):
> +            try:
> +                text = text.decode("utf-8")
> +            except UnicodeDecodeError as e:
> +                raise ValueError("Unable to decode string %s" %
> +                                 str(e.object).decode("utf-8",
> "replace"))
> ·
>           if row is None:
>               row = self._cursor[0]
>
>
Ack.


More information about the anaconda-patches mailing list