(I apologize if my summaries distort what Inada Naoki
<songofaca...@gmail.com> explained.)

He said that some people use the default None when they really want
either UTF-8 or ASCII.

My concern is that the warning will be a false alarm if they really do
need whatever locale returns, and that case may still be common.  (If
web browsers had stopped bothering to sniff for other charsets, then
maybe that situation really was getting rare.)

I asked when encoding=None is actually different from encoding=locale,
currently spelled encoding=locale.getpreferredencoding(False)

They can be different on Windows console, presumably because the
environment settings that control locale may differ from the charset
actually used by the console.  Even then, it only differs for open()
when PYTHONLEGACYWINDOWSSTDIO is set, and for TextIOWrapper() When the
file is not _WindowsConsoleIO

To me, that sounds narrow enough to be a windows issue, rather than an
issue with open.  Is there some way to write an encoding that sniffs
for charsets, particularly on windows, and to use that as the default
instead of assuming that locale will be correct?

-jJ
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/SSALFO3RTPX7QZ7B2MOWTZKYCJ5XKWK4/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to