For specific file streams, sure; here the programmer should define what is needed.
For inherited implicit file streams (stdin/out/err at the very least; potentially others... basically any file handle already open when python starts) then the _environment_ is the only place that can define the encoding. Let the programmer override as necessary.
There is no reason why "blah" and "blah | cat" should result in different encodings.
(no subject)
Date: 2007-12-15 11:05 pm (UTC)For inherited implicit file streams (stdin/out/err at the very least; potentially others... basically any file handle already open when python starts) then the _environment_ is the only place that can define the encoding. Let the programmer override as necessary.
There is no reason why "blah" and "blah | cat" should result in different encodings.