Skip to content

Commit 233ecad

Browse files
authored
PEP 597: Use longer option name (#1821)
1 parent aeab09a commit 233ecad

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pep-0597.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Add a new warning category ``EncodingWarning``. It is emitted when
1717
``encoding`` option is omitted and the default encoding is a locale
1818
encoding.
1919

20-
The warning is disabled by default. New ``-X warn_encoding``
21-
command-line option and ``PYTHONWARNENCODING`` environment variable
22-
are used to enable the warnings.
20+
The warning is disabled by default. New ``-X warn_default_encoding``
21+
command-line option and ``PYTHONWARNDEFAULTENCODING`` environment
22+
variable are used to enable the warnings.
2323

2424
``encoding="locale"`` option is added too. It is used to specify
2525
locale encoding explicitly.
@@ -109,9 +109,9 @@ omitted and the default encoding is locale-specific.
109109
Options to enable the warning
110110
------------------------------
111111

112-
``-X warn_encoding`` option and the ``PYTHONWARNENCODING``
113-
environment variable are added. They are used to enable the
114-
``EncodingWarning``.
112+
``-X warn_default_encoding`` option and the
113+
``PYTHONWARNDEFAULTENCODING`` environment variable are added. They
114+
are used to enable the ``EncodingWarning``.
115115

116116
``sys.flags.encoding_warning`` is also added. The flag represents
117117
``EncodingWarning`` is enabled.
@@ -255,8 +255,8 @@ Using ``open(filename)`` to read text files encoded in UTF-8 is a
255255
common mistake. It may not work on Windows because UTF-8 is not the
256256
default encoding.
257257

258-
You can use ``-X warn_encoding`` or ``PYTHONWARNENCODING=1`` to find
259-
this type of mistake.
258+
You can use ``-X warn_default_encoding`` or
259+
``PYTHONWARNDEFAULTENCODING=1`` to find this type of mistake.
260260

261261
Omitting ``encoding`` option is not a bug when opening text files
262262
encoded in locale encoding. But ``encoding="locale"`` is recommended

0 commit comments

Comments
 (0)