]> granicus.if.org Git - python/commitdiff
detach() is a nifty trick for making std* binary
authorBenjamin Peterson <benjamin@python.org>
Tue, 12 May 2009 03:01:51 +0000 (03:01 +0000)
committerBenjamin Peterson <benjamin@python.org>
Tue, 12 May 2009 03:01:51 +0000 (03:01 +0000)
Doc/library/sys.rst

index 51c85d43e8213e2360f538d4953db72144b3f0a2..0d92170b0998791e885a804dc081e1b29fda133f 100644 (file)
@@ -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__