Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3k
Changeset: r75823:b46622fb88b7
Date: 2015-02-10 23:00 +0100
http://bitbucket.org/pypy/pypy/changeset/b46622fb88b7/

Log:    Need to decode keys before calling newlist_unicode.

diff --git a/pypy/objspace/std/celldict.py b/pypy/objspace/std/celldict.py
--- a/pypy/objspace/std/celldict.py
+++ b/pypy/objspace/std/celldict.py
@@ -122,8 +122,8 @@
 
     def w_keys(self, w_dict):
         space = self.space
-        l = self.unerase(w_dict.dstorage).keys()
-        return space.newlist_unicode(l)
+        keys = self.unerase(w_dict.dstorage).keys()
+        return space.newlist_unicode([key.decode('utf-8') for key in keys])
 
     def values(self, w_dict):
         iterator = self.unerase(w_dict.dstorage).itervalues
diff --git a/pypy/objspace/std/kwargsdict.py b/pypy/objspace/std/kwargsdict.py
--- a/pypy/objspace/std/kwargsdict.py
+++ b/pypy/objspace/std/kwargsdict.py
@@ -115,8 +115,9 @@
             return w_dict.getitem(w_key)
 
     def w_keys(self, w_dict):
-        l = self.unerase(w_dict.dstorage)[0]
-        return self.space.newlist_unicode(l[:])
+        space = self.space
+        keys = self.unerase(w_dict.dstorage)[0]
+        return space.newlist_unicode([key.decode('utf-8') for key in keys])
 
     def values(self, w_dict):
         return self.unerase(w_dict.dstorage)[1][:] # to make non-resizable
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to