Author: Richard Plangger <[email protected]>
Branch: py3.5
Changeset: r90307:d7116d6e5a29
Date: 2017-02-22 16:57 +0100
http://bitbucket.org/pypy/pypy/changeset/d7116d6e5a29/
Log: call identifier_w on first param of call type("A\udcdcb", (), {}),
instead of text_w. do not ignore surrogate error
diff --git a/pypy/objspace/std/test/test_typeobject.py
b/pypy/objspace/std/test/test_typeobject.py
--- a/pypy/objspace/std/test/test_typeobject.py
+++ b/pypy/objspace/std/test/test_typeobject.py
@@ -1471,3 +1471,6 @@
#
assert type.__dict__['__name__'].__name__ == '__name__'
assert type.__dict__['__doc__'].__name__ == '__doc__'
+
+ def test_type_construct_unicode_surrogate_issue(self):
+ raises(ValueError, type, 'A\udcdcb', (), {})
diff --git a/pypy/objspace/std/typeobject.py b/pypy/objspace/std/typeobject.py
--- a/pypy/objspace/std/typeobject.py
+++ b/pypy/objspace/std/typeobject.py
@@ -724,7 +724,7 @@
return space.call_function(newfunc, w_winner, w_name, w_bases,
w_dict)
w_typetype = w_winner
- name = space.text_w(w_name)
+ name = space.identifier_w(w_name)
assert isinstance(name, str)
if '\x00' in name:
raise oefmt(space.w_ValueError, "type name must not contain null
characters")
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit