[Python-checkins] r72590 - python/branches/py3k/Doc/library/sys.rst

Nick Coghlan ncoghlan at gmail.com
Wed May 13 14:39:05 CEST 2009


benjamin.peterson wrote:
> Author: benjamin.peterson
> Date: Tue May 12 22:47:57 2009
> New Revision: 72590
> 
> Log:
> add example function
> 
> 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	Tue May 12 22:47:57 2009
> @@ -784,7 +784,13 @@
>     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.
> +   :meth:`io.TextIOWrapper.detach` streams can be made binary by default.  For
> +   example, this function sets all the standard streams to binary: ::
> +
> +      def make_streams_binary():
> +          sys.stdin = sys.stdin.detach()
> +          sys.stdout = sys.stout.detach()
Typo (missing 'd'):           ^^^^^

Cheers,
Nick.


-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------


More information about the Python-checkins mailing list