From: Ronald Oussoren Date: Sun, 7 Jul 2013 07:26:45 +0000 (+0200) Subject: Cleanup of documentation change from #17860 X-Git-Tag: v3.4.0a1~313^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=385521c90e35565ceb1bc54ab31b217321fd2d84;p=thirdparty%2FPython%2Fcpython.git Cleanup of documentation change from #17860 Reformulated the textual change, and applied it to the docstring as well. --- diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index cf9fd0b68301..3a30821aa8e5 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -290,11 +290,14 @@ default values. The arguments that are most commonly needed are: .. index:: single: universal newlines; subprocess module - 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) - `, otherwise these streams will be opened - as binary streams. For *stdin*, line ending characters + `. 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 diff --git a/Lib/subprocess.py b/Lib/subprocess.py index a62d9a455fee..35086ac4df16 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -104,6 +104,9 @@ in the child process prior to executing the command. If env is not None, it defines the environment variables for the new process. +If universal_newlines is false, the file objects stdin, stdout and stderr +are opened as binary files, and no line ending conversion is done. + If universal_newlines is true, the file objects stdout and stderr are opened as a text files, but lines may be terminated by any of '\n', the Unix end-of-line convention, '\r', the old Macintosh convention or