From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sat, 3 May 2025 02:38:35 +0000 (+0200) Subject: gh-91156: Document how TextIOWrapper interacts with UTF-8 mode (GH-132885) X-Git-Tag: v3.13.4~178 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb0a8575a7194e982e3dce6eb02600889f9e9f04;p=thirdparty%2FPython%2Fcpython.git gh-91156: Document how TextIOWrapper interacts with UTF-8 mode (GH-132885) Document how TextIOWrapper interacts with UTF-8 mode (cherry picked from commit 245cd6c53278006fa34fd7799d32f0884eb7e75d) Co-authored-by: Malcolm Smith --- diff --git a/Doc/library/io.rst b/Doc/library/io.rst index f793d7a7ef9a..cca9b8bf869f 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -950,7 +950,8 @@ Text I/O :class:`TextIOBase`. *encoding* gives the name of the encoding that the stream will be decoded or - encoded with. It defaults to :func:`locale.getencoding`. + encoded with. In :ref:`UTF-8 Mode `, this defaults to UTF-8. + Otherwise, it defaults to :func:`locale.getencoding`. ``encoding="locale"`` can be used to specify the current locale's encoding explicitly. See :ref:`io-text-encoding` for more information.