]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91156: Document how TextIOWrapper interacts with UTF-8 mode (GH-132885)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 3 May 2025 02:38:35 +0000 (04:38 +0200)
committerGitHub <noreply@github.com>
Sat, 3 May 2025 02:38:35 +0000 (11:38 +0900)
Document how TextIOWrapper interacts with UTF-8 mode
(cherry picked from commit 245cd6c53278006fa34fd7799d32f0884eb7e75d)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
Doc/library/io.rst

index f793d7a7ef9a84cbcc887b3fcc35acd65579361c..cca9b8bf869f2ac8fa54a67f5bad6fb61388231a 100644 (file)
@@ -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 <utf8-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.