[issue43140] built-in open() doesn't use locale.getpreferredencoding() as the default encoding

2021-02-05 Thread Cake Xu
Cake Xu added the comment: Thank Eryk for answering my question. So I get it now. I use this in Linux. If my understanding is right, the open() will invoke locale.getpreferredencoding() by setting the do_setlocale=False -- i.e. locale.getpreferredencoding(False) -- to avoid invoking

[issue43140] build-in open() doesn't use whatever locale.getpreferredencoding() returns as default encoding.

2021-02-05 Thread Cake Xu
Change by Cake Xu : -- type: -> behavior ___ Python tracker <https://bugs.python.org/issue43140> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue43140] build-in open() doesn't use whatever locale.getpreferredencoding() returns as default encoding.

2021-02-05 Thread Cake Xu
New submission from Cake Xu : In the document about build-in function open() https://docs.python.org/3/library/functions.html#open, it says that "encoding is the name of the encoding used to decode or encode the file. This should only be used in text mode. The default encoding is pla