Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cad4dca

Browse filesBrowse files
gh-90301: Doc: Add references to PEP 686 (GH-96816)
Doc: Add references to PEP 686. (cherry picked from commit 87679a6) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
1 parent 87a9e0f commit cad4dca
Copy full SHA for cad4dca

File tree

Expand file treeCollapse file tree

2 files changed

+14
-7
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+14
-7
lines changed

‎Doc/library/io.rst

Copy file name to clipboardExpand all lines: Doc/library/io.rst
+9-7Lines 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

Copy file name to clipboardExpand all lines: Doc/library/os.rst
+5Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.