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:
Victor Stinner 2025-08-06 14:35:27 +02:00 committed by GitHub
parent c17f378c0e
commit ce1b747ff6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 6 deletions

View file

@ -7684,10 +7684,6 @@ code_page_name(UINT code_page, PyObject **obj)
*obj = NULL;
if (code_page == CP_ACP)
return "mbcs";
if (code_page == CP_UTF7)
return "CP_UTF7";
if (code_page == CP_UTF8)
return "CP_UTF8";
*obj = PyBytes_FromFormat("cp%u", code_page);
if (*obj == NULL)