Skip to content

Commit c196dc6

Browse files
authored
PEP 686: Change target version to 3.13 (#2457)
1 parent 750ae13 commit c196dc6

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

pep-0686.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Status: Draft
66
Type: Standards Track
77
Content-Type: text/x-rst
88
Created: 18-Mar-2022
9-
Python-Version: 3.12
9+
Python-Version: 3.13
1010
Post-History: `18-Mar-2022 <https://discuss.python.org/t/14435>`__
1111

1212

@@ -55,14 +55,18 @@ User can still disable UTF-8 mode by setting ``PYTHONUTF8=0`` or ``-X utf8=0``.
5555
``locale.get_encoding()``
5656
-------------------------
5757

58-
Add ``locale.get_encoding()``. It is same to
59-
``locale.getpreferredencoding(False)`` except it don't follow UTF-8 mode.
58+
Currently, ``TextIOWrapper`` uses ``locale.getpreferredencoding(False)``
59+
when ``encoding="locale"`` option is specified. It is ``"UTF-8"`` in UTF-8 mode.
6060

61-
This API will be used by ``io.TextIOWrapper`` to support ``encoding="locale"``
62-
option.
61+
This behavior is inconsistent with the :pep:`597` motivation.
62+
``TextIOWrapper`` should use locale encoding when ``encoding="locale"`` is
63+
passed before/after the default encoding is changed to UTF-8.
6364

64-
This change will be released in Python 3.11 so that users can prepare before
65-
UTF-8 mode is enabled by default.
65+
To fix this inconsistency, we will add ``locale.get_encoding()``. It is same
66+
to ``locale.getpreferredencoding(False)`` but it ignore the UTF-8 mode.
67+
68+
This change will be released in Python 3.11 so that users can use UTF-8 mode
69+
that is same to Python 3.13.
6670

6771

6872
Backward Compatibility

0 commit comments

Comments
 (0)