File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -75,11 +75,24 @@ New features
75
75
Other language changes
76
76
======================
77
77
78
- * Python UTF-8 mode is now enabled by default.
79
- It may be disabled with by setting :envvar: `PYTHONUTF8=0 <PYTHONUTF8> ` as
80
- an environment variable or by using the :option: `-X utf8=0 <-X> ` flag.
81
- See :pep: `686 ` for further details.
78
+ * Python now uses UTF-8 as the default encoding, independent of the system's
79
+ environment. This means that I/O operations without an explicit encoding,
80
+ e.g. ``open('flying-circus.txt') ``, will use UTF-8.
82
81
82
+ This only applies when no ``encoding `` argument is given. For best
83
+ compatibility between versions of Python, ensure that an explicit ``encoding ``
84
+ argument is always provided. The :ref: `opt-in encoding warning <io-encoding-warning >`
85
+ can be used to identify code that may be affected by this change.
86
+ The special special ``encoding='locale' `` argument uses the current locale
87
+ encoding, and has been supported since Python 3.10.
88
+
89
+ To retain the previous behaviour, Python's UTF-8 mode may be disabled with
90
+ the :envvar: `PYTHONUTF8=0 <PYTHONUTF8> ` environment variable or the
91
+ :option: `-X utf8=0 <-X> ` command line option.
92
+
93
+ .. seealso :: :pep:`686` for further details.
94
+
95
+ (Contributed by Adam Turner in :gh: `133711 `; PEP 686 written by Inada Naoki.)
83
96
84
97
New modules
85
98
===========
You can’t perform that action at this time.
0 commit comments