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 Drekin
Recipients BreamoreBoy, David.Sankel, Drekin, Jonitis, akira, amaury.forgeotdarc, christian.heimes, christoph, davidsarah, ezio.melotti, flox, giampaolo.rodola, hippietrail, lemburg, mark, mhammond, ncoghlan, pitrou, santoso.wijaya, smerlin, ssbarnea, steve.dower, stijn, terry.reedy, tim.golden, tzot, v+python, wiz21
Date 2015-01-15.20:35:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1421354141.99.0.835748670803.issue1602@psf.upfronthosting.co.za>
In-reply-to
Content
File redirection has nothing to do with win-unicode-console and this issue. When stdout is redirected, it is not a tty so win-unicode-console doesn't replace the stream object, which is the right thing to do. You got UnicodeEncodeError because Python creates sys.stdout with encoding based on your locale. In my case it is cp1250 which cannot encode whole Unicode. You can control the encoding used by setting PYTHONIOENCODING environment variable. For example, if you have a script producer.py, which prints some Unicode characters, and consumer.py, which just does print(input()), then "py producer.py | py consumer.py" shows that redirection works (when PYTHONIOENCODING is set e.g. to utf-8).
History
Date User Action Args
2015-01-15 20:35:42Drekinsetrecipients: + Drekin, lemburg, mhammond, terry.reedy, tzot, amaury.forgeotdarc, ncoghlan, pitrou, giampaolo.rodola, christian.heimes, tim.golden, mark, christoph, ezio.melotti, v+python, hippietrail, ssbarnea, flox, davidsarah, santoso.wijaya, akira, BreamoreBoy, David.Sankel, smerlin, steve.dower, wiz21, stijn, Jonitis
2015-01-15 20:35:41Drekinsetmessageid: <1421354141.99.0.835748670803.issue1602@psf.upfronthosting.co.za>
2015-01-15 20:35:41Drekinlinkissue1602 messages
2015-01-15 20:35:41Drekincreate