From 06a3e1e0a6f2e414c878ec230f047073f374588b Mon Sep 17 00:00:00 2001 From: CAM Gerlach Date: Fri, 18 Mar 2022 20:25:23 -0500 Subject: [PATCH] PEP 686: Update URLs, PEP references, Discussions-To and CODEOWNERS per PEP 12 (#2444) --- .github/CODEOWNERS | 1 + pep-0686.rst | 40 ++++++++++++++++------------------------ 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 5b250f39244..3b0af8c4be3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -565,6 +565,7 @@ pep-0683.rst @ericsnowcurrently pep-0684.rst @ericsnowcurrently # pep-0684.rst pep-0685.rst @brettcannon +pep-0686.rst @methane # ... # pep-0754.txt # ... diff --git a/pep-0686.rst b/pep-0686.rst index a53d994b1ae..0978770670f 100644 --- a/pep-0686.rst +++ b/pep-0686.rst @@ -1,17 +1,19 @@ PEP: 686 Title: Make UTF-8 mode default Author: Inada Naoki +Discussions-To: https://discuss.python.org/t/14435 Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 18-Mar-2022 Python-Version: 3.12 +Post-History: `18-Mar-2022 `__ Abstract ======== -This PEP proposes making UTF-8 mode [1]_ on by default. +This PEP proposes making :pep:`UTF-8 mode <540>` on by default. With this change, Python uses UTF-8 for default encoding of files, stdio, and pipes consistently. @@ -86,19 +88,21 @@ To resolve this backward incompatibility, users can do: * Disable UTF-8 mode * Use ``EncodingWarning`` to find where the default encoding is used and use - ``encoding="locale"`` option to keep using locale encoding. [2]_ + ``encoding="locale"`` option to keep using locale encoding + (as defined in :pep:`597`). Preceding examples ================== -* Ruby changed the default ``external_encoding`` to UTF-8 on Windows in Ruby - 3.0 (2020). [3]_ -* Java changed the default text encoding to UTF-8 in JDK 18. (2022). [4]_ +* Ruby `changed `__ the default ``external_encoding`` + to UTF-8 on Windows in Ruby 3.0 (2020). +* Java `changed `__ the default text encoding + to UTF-8 in JDK 18. (2022). Both Ruby and Java have an option for backward compatibility. -They don't provide any warning like ``EncodingWarning`` [2]_ in Python for use -of the default encoding. +They don't provide any warning like :pep:`597`'s ``EncodingWarning`` +in Python for use of the default encoding. Rejected Alternative @@ -114,7 +118,7 @@ ASCII. And some users use Python only on Unix with UTF-8 locale. So forcing users to specify the ``encoding`` option everywhere is too painful. -Java also rejected this idea [4]_. +Java also rejected this idea in `JEP 400`_. How to teach this @@ -128,24 +132,12 @@ non-UTF-8 text files. For existing users, see `Backward compatibility`_ section. -Resources -========= - -.. [1] `PEP 540 – Add a new UTF-8 Mode`__ - - __ https://peps.python.org/pep-0540/ - -.. [2] `PEP 597 – Add optional EncodingWarning`__ - - __ https://peps.python.org/pep-0597/ - -.. [3] `Set default for Encoding.default_external to UTF-8 on Windows`__ - - __ https://bugs.ruby-lang.org/issues/16604 +References +========== -.. [4] `JEP 400: UTF-8 by Default`__ +.. _Feature #16604: https://bugs.ruby-lang.org/issues/16604 - __ https://openjdk.java.net/jeps/400 +.. _JEP 400: https://openjdk.java.net/jeps/400 Copyright