Author: Matti Picus <[email protected]>
Branch: unicode-utf8
Changeset: r95529:7df64fa7f398
Date: 2018-12-24 21:02 +0200
http://bitbucket.org/pypy/pypy/changeset/7df64fa7f398/

Log:    fix be8caf00c728 for bytes

diff --git a/pypy/interpreter/argument.py b/pypy/interpreter/argument.py
--- a/pypy/interpreter/argument.py
+++ b/pypy/interpreter/argument.py
@@ -545,7 +545,10 @@
                         # note: negative-based indexing from the end
                         w_name = keyword_names_w[i - len(keywords)]
                     except IndexError:
-                        name = '?'
+                        if keywords is None:
+                            name = '?'
+                        else:
+                            name = keywords[i]
                     else:
                         w_enc = space.newtext(space.sys.defaultencoding)
                         w_err = space.newtext("replace")
diff --git a/pypy/interpreter/test/test_argument.py 
b/pypy/interpreter/test/test_argument.py
--- a/pypy/interpreter/test/test_argument.py
+++ b/pypy/interpreter/test/test_argument.py
@@ -54,6 +54,9 @@
     pass
 
 class DummySpace(object):
+    class sys:
+        defaultencoding = 'utf-8'
+
     def newtuple(self, items):
         return tuple(items)
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to