mirror of
https://github.com/python/cpython.git
synced 2025-12-21 08:01:36 +00:00
gh-58124: Avoid CP_UTF8 in UnicodeDecodeError (#137415)
Fix name of the Python encoding in Unicode errors of the code page codec: use "cp65000" and "cp65001" instead of "CP_UTF7" and "CP_UTF8" which are not valid Python code names.
This commit is contained in:
parent
c17f378c0e
commit
ce1b747ff6
4 changed files with 5 additions and 6 deletions
|
|
@ -3293,7 +3293,7 @@ class CodePageTest(unittest.TestCase):
|
|||
codecs.code_page_encode, 932, '\xff')
|
||||
self.assertRaisesRegex(UnicodeDecodeError, 'cp932',
|
||||
codecs.code_page_decode, 932, b'\x81\x00', 'strict', True)
|
||||
self.assertRaisesRegex(UnicodeDecodeError, 'CP_UTF8',
|
||||
self.assertRaisesRegex(UnicodeDecodeError, 'cp65001',
|
||||
codecs.code_page_decode, self.CP_UTF8, b'\xff', 'strict', True)
|
||||
|
||||
def check_decode(self, cp, tests):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue