]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91156: Document how TextIOWrapper interacts with UTF-8 mode (GH-132885)
authorMalcolm Smith <smith@chaquo.com>
Sat, 3 May 2025 01:20:10 +0000 (02:20 +0100)
committerGitHub <noreply@github.com>
Sat, 3 May 2025 01:20:10 +0000 (10:20 +0900)
Document how TextIOWrapper interacts with UTF-8 mode

Doc/library/io.rst

index fcd7afea3544ddc090abd3279b5380d45bf5427d..3aa2f35f05eba0d598874fe8dc0b9944becb4043 100644 (file)
@@ -965,7 +965,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.