[Yum-devel] [PATCH] Fix: Unicode unequal comparison failed to convert both arguments to Unicode

James Antill james at and.org
Wed Oct 28 21:39:15 UTC 2009


---
 yum/packages.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/yum/packages.py b/yum/packages.py
index 709e73e..6941373 100644
--- a/yum/packages.py
+++ b/yum/packages.py
@@ -410,7 +410,10 @@ class RpmBase(object):
         # find the named entry in pkgobj, do the comparsion
         result = []
         for (n, f, (e, v, r)) in self.returnPrco(prcotype):
-            if reqn != n:
+            if isinstance(reqn, unicode) == isinstance(n, unicode):
+                if reqn != n: # stupid python...
+                    continue
+            elif misc.to_utf8(reqn) != misc.to_utf8(n):
                 continue
 
             if f == '=':
-- 
1.6.2.5



More information about the Yum-devel mailing list