summaryrefslogtreecommitdiffstats
path: root/Modules/_io/clinic
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2022-04-14 07:00:35 (GMT)
committerGitHub <noreply@github.com>2022-04-14 07:00:35 (GMT)
commit13b17e2a0a56d506d62a0bf2774e3deb4cbaeb72 (patch)
tree506c197765d1aa1f14cfe51134db7088288fd83c /Modules/_io/clinic
parent7b87e8af0cb8df0d76e8ab18a9b12affb4526103 (diff)
downloadcpython-13b17e2a0a56d506d62a0bf2774e3deb4cbaeb72.zip
cpython-13b17e2a0a56d506d62a0bf2774e3deb4cbaeb72.tar.gz
cpython-13b17e2a0a56d506d62a0bf2774e3deb4cbaeb72.tar.bz2
gh-91156: Fix `encoding="locale"` in UTF-8 mode (GH-70056)
Diffstat (limited to 'Modules/_io/clinic')
-rw-r--r--Modules/_io/clinic/_iomodule.c.h8
-rw-r--r--Modules/_io/clinic/textio.c.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/Modules/_io/clinic/_iomodule.c.h b/Modules/_io/clinic/_iomodule.c.h
index e4a6b8c..1fdbe68 100644
--- a/Modules/_io/clinic/_iomodule.c.h
+++ b/Modules/_io/clinic/_iomodule.c.h
@@ -22,9 +22,9 @@ PyDoc_STRVAR(_io_open__doc__,
"\'a\' for appending (which on some Unix systems, means that all writes\n"
"append to the end of the file regardless of the current seek position).\n"
"In text mode, if encoding is not specified the encoding used is platform\n"
-"dependent: locale.getpreferredencoding(False) is called to get the\n"
-"current locale encoding. (For reading and writing raw bytes use binary\n"
-"mode and leave encoding unspecified.) The available modes are:\n"
+"dependent: locale.getencoding() is called to get the current locale encoding.\n"
+"(For reading and writing raw bytes use binary mode and leave encoding\n"
+"unspecified.) The available modes are:\n"
"\n"
"========= ===============================================================\n"
"Character Meaning\n"
@@ -355,4 +355,4 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec
exit:
return return_value;
}
-/*[clinic end generated code: output=1a7fd7755c9a9609 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=e562f29e3c2533a6 input=a9049054013a1b77]*/
diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h
index 0b047ac..7e81eb3 100644
--- a/Modules/_io/clinic/textio.c.h
+++ b/Modules/_io/clinic/textio.c.h
@@ -146,7 +146,7 @@ PyDoc_STRVAR(_io_TextIOWrapper___init____doc__,
"Character and line based layer over a BufferedIOBase object, buffer.\n"
"\n"
"encoding gives the name of the encoding that the stream will be\n"
-"decoded or encoded with. It defaults to locale.getpreferredencoding(False).\n"
+"decoded or encoded with. It defaults to locale.getencoding().\n"
"\n"
"errors determines the strictness of encoding and decoding (see\n"
"help(codecs.Codec) or the documentation for codecs.register) and\n"
@@ -671,4 +671,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored))
{
return _io_TextIOWrapper_close_impl(self);
}
-/*[clinic end generated code: output=2604c8f3a45b9a03 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=e88abad34e31c0cb input=a9049054013a1b77]*/