Author r.david.murray
Recipients docs@python, r.david.murray
Date 2011-08-24.13:18:12
SpamBayes Score 1.77367e-09
Marked as misclassified No
Message-id <1314191894.1.0.666645625262.issue12832@psf.upfronthosting.co.za>
In-reply-to
Content
A common problem encountered when using python3 is writing non-ascii to stdout.  This will work fine if stdout is a terminal and the terminal encoding handles the characters, but will fail if stdout is later redirected to a pipe.  The docs for sys.stdout and for print should contain or point to an explanation of why, and how to solve the problem (ie: how to set the encoding for sys.stdout/sys.stderr).

Note that IMO it makes more sense for sys.stdout to default to the LOCALE encoding, but that should be a separate issue.
History
Date User Action Args
2011-08-24 13:18:14r.david.murraysetrecipients: + r.david.murray, docs@python
2011-08-24 13:18:14r.david.murraysetmessageid: <1314191894.1.0.666645625262.issue12832@psf.upfronthosting.co.za>
2011-08-24 13:18:13r.david.murraylinkissue12832 messages
2011-08-24 13:18:12r.david.murraycreate