[Python-checkins] r67635 - python/branches/py3k/Doc/library/sys.rst
benjamin.peterson
python-checkins at python.org
Sun Dec 7 15:58:03 CET 2008
Author: benjamin.peterson
Date: Sun Dec 7 15:58:03 2008
New Revision: 67635
Log:
document how to deal with binary standard streams
Modified:
python/branches/py3k/Doc/library/sys.rst
Modified: python/branches/py3k/Doc/library/sys.rst
==============================================================================
--- python/branches/py3k/Doc/library/sys.rst (original)
+++ python/branches/py3k/Doc/library/sys.rst Sun Dec 7 15:58:03 2008
@@ -709,6 +709,12 @@
:func:`os.popen`, :func:`os.system` or the :func:`exec\*` family of functions in
the :mod:`os` module.)
+ .. note::
+
+ The standard streams are text in text mode by default. To write or read
+ binary data to these, use the underlying binary buffer. For example, to
+ write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``.
+
.. data:: __stdin__
__stdout__
More information about the Python-checkins
mailing list