pypy/module/_codecs/test/test_locale.py::TestLocaleCodec::()::test_encode_locale_errorhandler
self = <pypy.module._codecs.test.test_locale.TestLocaleCodec object at 0x000001a22ece88a8>
def test_encode_locale_errorhandler(self):
self.setlocale("en_US.UTF-8")
locale_encoder = utf8_encode_locale_surrogateescape
utf8_encoder = self.getencoder('utf-8')
encode_error_handler = self.getstate().encode_error_handler
for val in u'foo\udc80bar', u'\udcff\U0001320C':
s = val.encode('utf8')
w_s = self.space.newtext(s)
expected = utf8_encoder(self.space, s, w_s, 'surrogateescape',
encode_error_handler)
utf8 = val.encode('utf-8')
> assert locale_encoder(utf8, len(val)) == expected
E assert '\xff\xe3\x88\x8c' == '\xff\xf0\x93\x88\x8c'
E - \xff\xe3\x88\x8c
E ? ^
E + \xff\xf0\x93\x88\x8c
E ? ^^^^^
module\_codecs\test\test_locale.py:58: AssertionError
builder: own-win-x86-64 build #2236
test: pypy/module/_codecs/test/test_locale/py/TestLocaleCodec/()/test_encode_locale_errorhandler