[Python-Dev] [Python-checkins] cpython (3.3): Issue #17860: explicitly mention that std* streams are opened in binary mode by

R. David Murray rdmurray at bitdance.com
Sun Jul 7 06:59:18 CEST 2013


On Sat, 06 Jul 2013 08:14:26 -0700, "Gregory P. Smith" <greg at krypto.org> wrote:
> Please update the docstring in subprocess.py with the wording improvements
> that you settle on while you're at it.
> 
> On Sat, Jul 6, 2013 at 6:03 AM, Ronald Oussoren <ronaldoussoren at mac.com>wrote:
> > I didn't like the parenthentical after all. Would this work for you?:
> >
> > -   If *universal_newlines* is ``True``, the file objects *stdin*,
> > *stdout* and
> > -   *stderr* will be opened as text streams in :term:`universal newlines`
> > mode
> > +   If *universal_newlines* is ``False`` the file objects *stdin*,
> > *stdout* and
> > +   *stderr* will be opened as binary streams, and no line ending
> > conversion is done.
> > +
> > +   If *universal_newlines* is ``True``, these file objects
> > +   will be opened as text streams in :term:`universal newlines` mode
> >     using the encoding returned by
> > :func:`locale.getpreferredencoding(False)
> > -   <locale.getpreferredencoding>`, otherwise these streams will be opened
> > -   as binary streams.  For *stdin*, line ending characters
> > +   <locale.getpreferredencoding>`.  For *stdin*, line ending characters
> >     ``'\n'`` in the input will be converted to the default line separator
> >     :data:`os.linesep`.  For *stdout* and *stderr*, all line endings in the
> >     output will be converted to ``'\n'``.  For more information see the
> >
> > That is, a new paragraph is added before the existing one to explain the
> > behavior of "not universal_newlines".

Looks good to me.

--David


More information about the Python-Dev mailing list