We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c981ff commit 5bed110Copy full SHA for 5bed110
Objects/unicodeobject.c
@@ -16455,9 +16455,9 @@ config_get_codec_name(wchar_t **config_encoding)
16455
16456
PyObject *name_obj = NULL;
16457
PyObject *codec = _PyCodec_Lookup(encoding);
16458
+ PyMem_RawFree(encoding);
16459
16460
if (!codec) { // Fallback to UTF-8 if the codec is not found
- PyMem_RawFree(encoding);
16461
PyErr_Clear();
16462
16463
wchar_t *utf8_encoding = _PyMem_RawWcsdup(L"utf-8");
@@ -16471,8 +16471,6 @@ config_get_codec_name(wchar_t **config_encoding)
16471
return 0;
16472
}
16473
16474
16475
-
16476
name_obj = PyObject_GetAttrString(codec, "name");
16477
Py_CLEAR(codec);
16478
if (!name_obj) {
0 commit comments