diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-05-12 03:01:51 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-05-12 03:01:51 (GMT) |
commit | 3261fa5a6ba6afd04cf508ed9a59482021c9ae43 (patch) | |
tree | 4bee6b566a774b5fa1a79ea6d6af5dfd4f77c90b /Doc | |
parent | ff85bcac22810536c15a96cc43184e83cd470310 (diff) | |
download | cpython-3261fa5a6ba6afd04cf508ed9a59482021c9ae43.zip cpython-3261fa5a6ba6afd04cf508ed9a59482021c9ae43.tar.gz cpython-3261fa5a6ba6afd04cf508ed9a59482021c9ae43.tar.bz2 |
detach() is a nifty trick for making std* binary
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/sys.rst | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 51c85d4..0d92170 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -781,11 +781,10 @@ always available. :func:`os.popen`, :func:`os.system` or the :func:`exec\*` family of functions in 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 to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``. + 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 + to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``. Using + :meth:`io.TextIOWrapper.detach` streams can be made binary by default. .. data:: __stdin__ |