Message92207
Well, I would suggest using the terminal encoding as default one when
redirecting. In my opinion sys.stdin and sys.stdout should always have
the terminal encoding
Alternatively you could make the function sys.setdefaultencoding()
visible to change it in a reasonable way
Jerzy
Georg Brandl wrote:
> Georg Brandl <georg@python.org> added the comment:
>
> When output goes to a terminal, Python can determine its encoding. For a
> file, it cannot, therefore it refuses to guess.
>
> Also, many programs behave differently when used with redirection;
> namely, all those that use `isatty()` to determine if stdout is a terminal.
>
> ----------
> nosy: +georg.brandl
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue6832>
> _______________________________________
>
>
>
> |
|
Date |
User |
Action |
Args |
2009-09-03 12:27:20 | Orlowski | set | recipients:
+ Orlowski, georg.brandl, benjamin.peterson |
2009-09-03 12:27:19 | Orlowski | link | issue6832 messages |
2009-09-03 12:27:18 | Orlowski | create | |
|