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

2021-02-12 Thread Eryk Sun
Eryk Sun added the comment: > 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 > setlocale(LC_CTYPE, ""). Yes, that's the case in POSIX systems. With

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

2021-02-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Eryk, are you suggesting that this should be closed as 'Not a bug'? -- nosy: +terry.reedy ___ Python tracker ___

[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] built-in open() doesn't use locale.getpreferredencoding() as the default encoding

2021-02-05 Thread Eryk Sun
Change by Eryk Sun : -- components: +IO, Library (Lib) title: build-in open() doesn't use whatever locale.getpreferredencoding() returns as default encoding. -> built-in open() doesn't use locale.getpreferredencoding() as the default encoding versions: +Python 3.10