utf-8 encode yum actions before displaying them (#1072362)
Otherwise running lorax in other locales will crash. Resolves: rhbz#1072362
This commit is contained in:
parent
ee71bc9b11
commit
39e4da7ce8
@ -96,10 +96,11 @@ class LoraxRpmCallback(yum.rpmtrans.RPMBaseCallback):
|
|||||||
def event(self, package, action, te_current, te_total,
|
def event(self, package, action, te_current, te_total,
|
||||||
ts_current, ts_total):
|
ts_current, ts_total):
|
||||||
|
|
||||||
|
action_str = self.action[action].encode("utf-8")
|
||||||
info = "({0:3d}/{1:3d}) [{2:3.0f}%] {3} "
|
info = "({0:3d}/{1:3d}) [{2:3.0f}%] {3} "
|
||||||
info = info.format(ts_current, ts_total,
|
info = info.format(ts_current, ts_total,
|
||||||
float(te_current) / float(te_total) * 100,
|
float(te_current) / float(te_total) * 100,
|
||||||
self.action[action].lower())
|
action_str.lower())
|
||||||
|
|
||||||
pkg = "{0}".format(package)
|
pkg = "{0}".format(package)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user