This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Orlowski
Recipients Orlowski, benjamin.peterson, georg.brandl
Date 2009-09-03.12:27:18
SpamBayes Score 6.390744e-05
Marked as misclassified No
Message-id <4A9FB612.2000008@genesilico.pl>
In-reply-to <1251980529.03.0.218206602557.issue6832@psf.upfronthosting.co.za>
Content
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>
> _______________________________________
>
>
>
>
History
Date User Action Args
2009-09-03 12:27:20Orlowskisetrecipients: + Orlowski, georg.brandl, benjamin.peterson
2009-09-03 12:27:19Orlowskilinkissue6832 messages
2009-09-03 12:27:18Orlowskicreate