compat: some 2.x pypy versions produce UnicodeEncodeError: 'ascii' codec can't encode character on surrogates (uni_string must be fixed also for UTF-8 system encoding)

pull/2814/head
sebres 2020-08-04 14:52:15 +02:00
parent 9510346507
commit 253d47d33c
1 changed files with 2 additions and 1 deletions

View File

@ -201,7 +201,8 @@ class TestsUtilsTest(LogCaptureTestCase):
uni_decode((b'test\xcf' if sys.version_info >= (3,) else u'test\xcf'))
uni_string(b'test\xcf')
uni_string('test\xcf')
uni_string(u'test\xcf')
if sys.version_info < (3,) and 'PyPy' not in sys.version:
uni_string(u'test\xcf')
def testSafeLogging(self):
# logging should be exception-safe, to avoid possible errors (concat, str. conversion, representation failures, etc)