pypy/interpreter/test/test_objspace.py::TestObjSpace::()::test_text_w
self = <pypy.interpreter.test.test_objspace.TestObjSpace instance at 0x00007fc9eb5cf2e0>
def test_text_w(self):
space = self.space
x = u'àèì'
> w_name = space.wrap(x)
interpreter/test/test_objspace.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
objspace/std/objspace.py:173: in wrap
lgt = rutf8.check_utf8(x, True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
s = '\xc3\xa0\xc3\xa8\xc3\xac', allow_surrogates = True, start = 0, stop = -1
def check_utf8(s, allow_surrogates, start=0, stop=-1):
"""Check that 's' is a utf-8-encoded byte string.
Returns the length (number of chars) or raise CheckError.
If allow_surrogates is False, then also raise if we see any.
Note also codepoints_in_utf8(), which also computes the length
faster by assuming that 's' is valid utf-8.
"""
res = _check_utf8(s, allow_surrogates, start, stop)
if res >= 0:
return res
> raise CheckError(~res)
E CheckError
../rpython/rlib/rutf8.py:362: CheckError
builder: own-macos-x86-64 build #1268+
test: pypy/interpreter/test/test_objspace.py::TestObjSpace::()::test_text_w