[Python-Dev] Proposal: new environment variable PYTHONSTDOUTENCODING

"Martin v. Löwis" martin at v.loewis.de
Tue May 20 22:22:03 CEST 2008


>    Is it to override locale settings in case the user wants a different
> encoding? for such cases as redirected stdout, or windows console (which
> has an "OEM" encoding that differs from the locale encoding)?

On Windows, the setlocale mechanism isn't used at all, since it doesn't
support nl_langinfo (let alone CODESET).

And yes, that is to override whatever determination Python would make on
its own.

>> Naming contest: it probably would be the longest of the PYTHON*
>> variables. I would not want to call it PYTHONENCODING, or
>> PYTHONSTDENCODING, though, because people might infer that it
>> affects sys.getdefaultencoding(), which it shouldn't.
> 
>    PYTHONIOENCODING?

Unprecise in a different way (as it is meant to apply only to stdout,
not to all IO), but shorter.

Regards,
Martin


More information about the Python-Dev mailing list