From e85cf5f4aeff545252254d6c7ba0e04cf05d0f50 Mon Sep 17 00:00:00 2001 From: Malcolm Smith Date: Sat, 3 May 2025 02:20:10 +0100 Subject: [PATCH] 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 --- Doc/library/io.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/io.rst b/Doc/library/io.rst index f793d7a7ef9a84..cca9b8bf869f2a 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.