File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Status: Draft
66Type: Standards Track
77Content-Type: text/x-rst
88Created: 18-Mar-2022
9- Python-Version: 3.12
9+ Python-Version: 3.13
1010Post-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
6872Backward Compatibility
You can’t perform that action at this time.
0 commit comments