Message386884
> 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 do_setlocale=False, getpreferredencoding() gets the current locale's LC_CTYPE codeset via nl_langinfo(CODESET). This is thread safe, whereas calling setlocale(LC_CTYPE, "") beforehand is not thread safe.
In Windows, locale.getpreferredencoding() always returns the encoding of the default locale, regardless of do_setlocale. It's needlessly inconsistent with POSIX.
> are you suggesting that this should be closed as 'Not a bug'?
Sorry, Terry. I forgot to close the issue. |
|
Date |
User |
Action |
Args |
2021-02-12 22:12:24 | eryksun | set | recipients:
+ eryksun, terry.reedy, docs@python, smallbigcake |
2021-02-12 22:12:24 | eryksun | set | messageid: <1613167944.85.0.278537081863.issue43140@roundup.psfhosted.org> |
2021-02-12 22:12:24 | eryksun | link | issue43140 messages |
2021-02-12 22:12:24 | eryksun | create | |
|