Jerzy <jer...@genesilico.pl> added the comment: 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 <ge...@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 <rep...@bugs.python.org> > <http://bugs.python.org/issue6832> > _______________________________________ > > > > ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6832> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com