[Python-Dev] Issue #11022: locale.getpreferredencoding() must not set temporary LC_CTYPE (original) (raw)
Victor Stinner victor.stinner at gmail.com
Tue Jun 5 13:55:20 CEST 2012
- Previous message: [Python-Dev] Issue #11022: locale.getpreferredencoding() must not set temporary LC_CTYPE
- Next message: [Python-Dev] Language reference updated for metaclasses
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Fine with me.
Ok, done with changeset 2587328c7c9c.
So in theory, your change should have no effect, unless somebody has modified some environment variables.
Changing TextIOWrapper to call locale.getpreferredlocale(False) instead of getpreferredlocale() has these two effects:
without the patch, setting LC_ALL, LC_CTYPE or LANG environment variable changes the encoding used by TextIOWrapper.
with the patch, setting LC_CTYPE (with locale.setlocale) changes the the encoding used by TextIOWrapper.
IMO (2) is less surprising than (1) For example, it is the expected behaviour of the reporter of the issue #11022.
In practice, it should not change anything for most people.
Victor
- Previous message: [Python-Dev] Issue #11022: locale.getpreferredencoding() must not set temporary LC_CTYPE
- Next message: [Python-Dev] Language reference updated for metaclasses
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]