mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
bpo-42065: Fix incorrectly formatted _codecs.charmap_decode error message (GH-19940)
(cherry picked from commit 3635388f52
)
Co-authored-by: Max Bernstein <tekknolagi@users.noreply.github.com>
This commit is contained in:
parent
0fbddb14dc
commit
6a2aa4994e
3 changed files with 16 additions and 1 deletions
|
@ -2183,6 +2183,18 @@ class CharmapTest(unittest.TestCase):
|
|||
("", len(allbytes))
|
||||
)
|
||||
|
||||
self.assertRaisesRegex(TypeError,
|
||||
"character mapping must be in range\\(0x110000\\)",
|
||||
codecs.charmap_decode,
|
||||
b"\x00\x01\x02", "strict", {0: "A", 1: 'Bb', 2: -2}
|
||||
)
|
||||
|
||||
self.assertRaisesRegex(TypeError,
|
||||
"character mapping must be in range\\(0x110000\\)",
|
||||
codecs.charmap_decode,
|
||||
b"\x00\x01\x02", "strict", {0: "A", 1: 'Bb', 2: 999999999}
|
||||
)
|
||||
|
||||
def test_decode_with_int2int_map(self):
|
||||
a = ord('a')
|
||||
b = ord('b')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue