]> granicus.if.org Git - python/commitdiff
#1344: document that you need to open std{in,out,err} with PIPE if you want
authorGeorg Brandl <georg@python.org>
Sat, 24 Nov 2007 11:31:46 +0000 (11:31 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 24 Nov 2007 11:31:46 +0000 (11:31 +0000)
communicate() to work as described.

Doc/library/subprocess.rst

index 64bc70bfe8a2e6c2dc877dbdada4fad5d51d1375..17242c42f78b28ecb73e3f720eef28a9de5149e9 100644 (file)
@@ -195,7 +195,12 @@ Instances of the :class:`Popen` class have the following methods:
 
    communicate() returns a tuple (stdout, stderr).
 
-   .. note::
+   Note that if you want to send data to the process's stdin, you need to create
+   the Popen object with ``stdin=PIPE``.  Similarly, to get anything other than
+   ``None`` in the result tuple, you need to give ``stdout=PIPE`` and/or
+   ``stderr=PIPE`` too.
+
+.. note::
 
       The data read is buffered in memory, so do not use this method if the data size
       is large or unlimited.