Update documentation to mention bytes instead byte string and correct one

mentioned string to the accurate description of what type is required.
This commit is contained in:
Gregory P. Smith 2011-05-22 22:29:49 -07:00
parent 6352298ac4
commit a454ef6985
2 changed files with 6 additions and 5 deletions

View File

@ -311,7 +311,7 @@ This module also defines the following shortcut functions:
.. function:: check_output(*popenargs, timeout=None, **kwargs) .. 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 If the exit code was non-zero it raises a :exc:`CalledProcessError`. The
:exc:`CalledProcessError` object will have the return code in 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, 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 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 *input* argument should be data to be sent to the child process, or
``None``, if no data should be sent to the child. ``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)``. :meth:`communicate` returns a tuple ``(stdoutdata, stderrdata)``.

View File

@ -817,8 +817,8 @@ class Popen(object):
def communicate(self, input=None, timeout=None): def communicate(self, input=None, timeout=None):
"""Interact with process: Send data to stdin. Read data from """Interact with process: Send data to stdin. Read data from
stdout and stderr, until end-of-file is reached. Wait for stdout and stderr, until end-of-file is reached. Wait for
process to terminate. The optional input argument should be a process to terminate. The optional input argument should be
string to be sent to the child process, or None, if no data bytes to be sent to the child process, or None, if no data
should be sent to the child. should be sent to the child.
communicate() returns a tuple (stdout, stderr).""" communicate() returns a tuple (stdout, stderr)."""