[blivet] Convert the string representation of Size to a str type. (#1060382)

David Shea dshea at redhat.com
Mon Feb 3 09:45:59 UTC 2014


The return value of Size.humanReadable is sometimes a unicode, since the
translated units need to be unicode in order for upper/lower to work.
Convert the value back to a str so that __str__ conversions don't get
confused.
---
 blivet/size.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/blivet/size.py b/blivet/size.py
index e7b6d30..dd19201 100644
--- a/blivet/size.py
+++ b/blivet/size.py
@@ -207,7 +207,7 @@ class Size(Decimal):
         return self
 
     def __str__(self, context=None):
-        return self.humanReadable()
+        return str(self.humanReadable())
 
     def __repr__(self):
         return "Size('%s')" % self
-- 
1.8.5.3



More information about the anaconda-patches mailing list