Eryk Sun <eryk...@gmail.com> 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 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. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue43140> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com