Commit 3261fa5a authored by Benjamin Peterson's avatar Benjamin Peterson

detach() is a nifty trick for making std* binary

parent ff85bcac
...@@ -781,11 +781,10 @@ always available. ...@@ -781,11 +781,10 @@ always available.
:func:`os.popen`, :func:`os.system` or the :func:`exec\*` family of functions in :func:`os.popen`, :func:`os.system` or the :func:`exec\*` family of functions in
the :mod:`os` module.) the :mod:`os` module.)
.. note:: The standard streams are in text mode by default. To write or read binary
data to these, use the underlying binary buffer. For example, to write bytes
The standard streams are in text mode by default. To write or read binary to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``. Using
data to these, use the underlying binary buffer. For example, to write :meth:`io.TextIOWrapper.detach` streams can be made binary by default.
bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``.
.. data:: __stdin__ .. data:: __stdin__
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment