New submission from R. David Murray <rdmur...@bitdance.com>:

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.

----------
assignee: docs@python
components: Documentation
messages: 142880
nosy: docs@python, r.david.murray
priority: normal
severity: normal
status: open
title: The documentation for the print function should explain/point to how to 
control the sys.stdout encoding
versions: Python 2.7, Python 3.2, Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12832>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to