[master/rhel7] utf-8 encode yum actions before displaying them (#1072362)

Vratislav Podzimek vpodzime at redhat.com
Wed Mar 5 10:35:59 UTC 2014


On Tue, 2014-03-04 at 15:15 -0800, Brian C. Lane wrote:
> Otherwise running lorax in other locales will crash.
> 
> Resolves: rhbz#1072362
> ---
>  src/pylorax/yumhelper.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/pylorax/yumhelper.py b/src/pylorax/yumhelper.py
> index 13a2bda..6732c35 100644
> --- a/src/pylorax/yumhelper.py
> +++ b/src/pylorax/yumhelper.py
> @@ -96,10 +96,11 @@ class LoraxRpmCallback(yum.rpmtrans.RPMBaseCallback):
>      def event(self, package, action, te_current, te_total,
>                ts_current, ts_total):
>  
> +        action_str = self.action[action].encode("utf-8")
>          info = "({0:3d}/{1:3d}) [{2:3.0f}%] {3} "
>          info = info.format(ts_current, ts_total,
>                             float(te_current) / float(te_total) * 100,
> -                           self.action[action].lower())
> +                           action_str.lower())
>  
>          pkg = "{0}".format(package)
ACK.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list