[issue14192] stdout.encoding not set when redirecting windows command line output

Martin v. Löwis report at bugs.python.org
Sun Mar 4 15:54:44 CET 2012

Martin v. Löwis <martin at v.loewis.de> added the comment:

> I have to take it, although I am not really convinced. The system  
> codepage probably differs from the console codepage (here 1152 vs.  
> 850). Print statements on the other hand are typical for console  
> programs. Calling python.exe (vs. pythonw.exe) means console program  
> means print output has to use console codepage as default.

I think in practice, this statement is incorrect for most applications.
When they use print, they want to create text files, and those will
be opened with notepad (or some other text editor on Windows), and will
have to be in cp1252. So guessing that it should be cp850 will be incorrect
most of the time.

In any case, you have perfectly described why the initial design decision
in Python 2 was to refuse to guess.


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list