]> granicus.if.org Git - python/commitdiff
Update documentation to mention bytes instead byte string and correct one
authorGregory P. Smith <greg@krypto.org>
Mon, 23 May 2011 05:29:49 +0000 (22:29 -0700)
committerGregory P. Smith <greg@krypto.org>
Mon, 23 May 2011 05:29:49 +0000 (22:29 -0700)
mentioned string to the accurate description of what type is required.

Doc/library/subprocess.rst
Lib/subprocess.py

index ad5a535a7df03041561fe703876e3bedf00da159..a0d847139a9f2971bc27c06f6ccaaa81b676bf82 100644 (file)
@@ -311,7 +311,7 @@ This module also defines the following shortcut functions:
 
 .. function:: check_output(*popenargs, timeout=None, **kwargs)
 
-   Run command with arguments and return its output as a byte string.
+   Run command with arguments and return its output as a bytes object.
 
    If the exit code was non-zero it raises a :exc:`CalledProcessError`.  The
    :exc:`CalledProcessError` object will have the return code in the
@@ -447,8 +447,9 @@ Instances of the :class:`Popen` class have the following methods:
 
    Interact with process: Send data to stdin.  Read data from stdout and stderr,
    until end-of-file is reached.  Wait for process to terminate.  The optional
-   *input* argument should be a byte string to be sent to the child process, or
-   ``None``, if no data should be sent to the child.
+   *input* argument should be data to be sent to the child process, or
+   ``None``, if no data should be sent to the child.  The type of *input*
+   must be bytes or, if *universal_newlines* was ``True``, a string.
 
    :meth:`communicate` returns a tuple ``(stdoutdata, stderrdata)``.
 
index cd8aa6bc56c590c747ce331f45cbdefb48a6e835..c5128d857aa981203a7a1a8335a7b9636e49e072 100644 (file)
@@ -817,8 +817,8 @@ class Popen(object):
     def communicate(self, input=None, timeout=None):
         """Interact with process: Send data to stdin.  Read data from
         stdout and stderr, until end-of-file is reached.  Wait for
-        process to terminate.  The optional input argument should be a
-        string to be sent to the child process, or None, if no data
+        process to terminate.  The optional input argument should be
+        bytes to be sent to the child process, or None, if no data
         should be sent to the child.
 
         communicate() returns a tuple (stdout, stderr)."""