classification
Title: Popen() object stdout attribute reassignment behaviour
Type: behavior Stage:
Components: Documentation Versions: Python 2.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, vincent.legoll
Priority: Keywords:

Created on 2008-08-26 15:57 by vincent.legoll, last changed 2008-08-26 15:57 by vincent.legoll.

Messages
msg71983 (view) Author: Vincent Legoll (vincent.legoll) Date: 2008-08-26 15:57
The subprocess.Popen() object documentation should indicate
that the stdout attribute should not be modified after
object construction. Because that won't work.

Or the attribute may be rendered read-only

>>> from subprocess import Popen, PIPE
>>> import sys, os
>>> p1 = Popen(["echo", "1"], stdout = PIPE)
>>> p2 = Popen(["cat"], stdin = p1.stdout, stderr = PIPE, stdout = PIPE)
>>> p2.stdout = sys.stdout
>>> print p2.communicate()

This blocks forever
History
Date User Action Args
2008-08-26 15:57:45vincent.legollcreate