Skip to content

Commit 87679a6

Browse files
authored
pythongh-90301: Doc: Add references to PEP 686 (python#96816)
Doc: Add references to PEP 686.
1 parent 9fbfa42 commit 87679a6

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

Doc/library/io.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,19 @@ encoding is not UTF-8 for most Windows users. For example::
123123
with open("README.md") as f:
124124
long_description = f.read()
125125

126-
Additionally, while there is no concrete plan as of yet, Python may change
127-
the default text file encoding to UTF-8 in the future.
128-
129126
Accordingly, it is highly recommended that you specify the encoding
130127
explicitly when opening text files. If you want to use UTF-8, pass
131128
``encoding="utf-8"``. To use the current locale encoding,
132-
``encoding="locale"`` is supported in Python 3.10.
129+
``encoding="locale"`` is supported since Python 3.10.
130+
131+
.. seealso::
132+
133+
:ref:`utf8-mode`
134+
Python UTF-8 Mode can be used to change the default encoding to
135+
UTF-8 from locale-specific encoding.
133136

134-
When you need to run existing code on Windows that attempts to open
135-
UTF-8 files using the default locale encoding, you can enable the UTF-8
136-
mode. See :ref:`UTF-8 mode on Windows <win-utf8-mode>`.
137+
:pep:`686`
138+
Python 3.15 will make :ref:`utf8-mode` default.
137139

138140
.. _io-encoding-warning:
139141

Doc/library/os.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ can be read from :data:`sys.flags.utf8_mode <sys.flags>`.
159159
See also the :ref:`UTF-8 mode on Windows <win-utf8-mode>`
160160
and the :term:`filesystem encoding and error handler`.
161161

162+
.. seealso::
163+
164+
:pep:`686`
165+
Python 3.15 will make :ref:`utf8-mode` default.
166+
162167

163168
.. _os-procinfo:
164169

0 commit comments

Comments
 (0)