diff options
author | Inada Naoki <songofacandy@gmail.com> | 2022-04-04 02:46:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-04 02:46:57 (GMT) |
commit | 4216dce04b7d3f329beaaafc82a77c4ac6cf4d57 (patch) | |
tree | b3ff3df025ddb3c383beb156fd150df62d40ac8e /Python | |
parent | 6db2db91b96aaa1270c200ec931a2250fe2799c7 (diff) | |
download | cpython-4216dce04b7d3f329beaaafc82a77c4ac6cf4d57.zip cpython-4216dce04b7d3f329beaaafc82a77c4ac6cf4d57.tar.gz cpython-4216dce04b7d3f329beaaafc82a77c4ac6cf4d57.tar.bz2 |
bpo-47000: Make `io.text_encoding()` respects UTF-8 mode (GH-32003)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r-- | Python/sysmodule.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 5765e9e..de4e10a 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -841,7 +841,10 @@ static PyObject * sys_getdefaultencoding_impl(PyObject *module) /*[clinic end generated code: output=256d19dfcc0711e6 input=d416856ddbef6909]*/ { - return PyUnicode_FromString(PyUnicode_GetDefaultEncoding()); + _Py_DECLARE_STR(utf_8, "utf-8"); + PyObject *ret = &_Py_STR(utf_8); + Py_INCREF(ret); + return ret; } /*[clinic input] |