[blivet] Add another .decode("utf-8") to humanReadable (#1059807)

David Shea dshea at redhat.com
Wed Feb 5 08:28:00 UTC 2014


This way Size.humanReadable always returns a unicode object that __str__
can always convert back to a str.
---
 blivet/size.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/blivet/size.py b/blivet/size.py
index 65668c5..03bfa38 100644
--- a/blivet/size.py
+++ b/blivet/size.py
@@ -279,7 +279,7 @@ class Size(Decimal):
         check = self._trimEnd("%d" % self)
 
         if abs(Decimal(check)) < 1000:
-            return "%s %s" % (check, _("B"))
+            return "%s %s" % (check, _("B").decode("utf-8"))
 
         for factor, prefix, abbr in _xlated_prefixes():
             newcheck = super(Size, self).__div__(Decimal(factor))
-- 
1.8.5.3



More information about the anaconda-patches mailing list