mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Changes in anticipation of stricter str vs. bytes enforcement.
This commit is contained in:
parent
85825dc1ff
commit
39478e8528
15 changed files with 78 additions and 76 deletions
|
@ -701,7 +701,7 @@ class UnicodeTest(
|
|||
if not sys.platform.startswith('java'):
|
||||
self.assertEqual(
|
||||
str(
|
||||
buffer('character buffers are decoded to unicode'),
|
||||
buffer(b'character buffers are decoded to unicode'),
|
||||
'utf-8',
|
||||
'strict'
|
||||
),
|
||||
|
@ -791,7 +791,7 @@ class UnicodeTest(
|
|||
self.assertEqual(str(b'Andr\202 x', 'ascii', 'replace'), 'Andr\uFFFD x')
|
||||
|
||||
# Error handling (unknown character names)
|
||||
self.assertEqual("\\N{foo}xx".decode("unicode-escape", "ignore"), "xx")
|
||||
self.assertEqual(b"\\N{foo}xx".decode("unicode-escape", "ignore"), "xx")
|
||||
|
||||
# Error handling (truncated escape sequence)
|
||||
self.assertRaises(UnicodeError, "\\".decode, "unicode-escape")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue