[docs] [issue12832] The documentation for the print function should explain/point to how to control the sys.stdout encoding

R. David Murray report at bugs.python.org
Wed Aug 24 15:18:14 CEST 2011


New submission from R. David Murray <rdmurray at 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 at python
components: Documentation
messages: 142880
nosy: docs at 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 <report at bugs.python.org>
<http://bugs.python.org/issue12832>
_______________________________________


More information about the docs mailing list