24 Jan
2021
24 Jan
'21
5:49 a.m.
On Sun, Jan 24, 2021 at 2:46 PM Matt Wozniski
2. At the same time as the deprecation is announced, introduce a new __future__ import named "utf8_open" or something like that, to opt into the future behavior of `open` defaulting to utf-8-sig or utf-8 when opening a file in text mode and no explicit encoding is specified.
I think a __future__ import solves the problem better than introducing a new function would.
Note that, since this doesn't involve any language or syntax changes, a regular module import would work here - something like "from utf8mode import open", which would then shadow the builtin. Otherwise no change to your proposal - everything else works exactly the same way. ChrisA