Issue 3687: Popen() object stdout attribute reassignment behaviour (original) (raw)
Issue3687
Created on 2008-08-26 15:57 by vincent.legoll, last changed 2022-04-11 14:56 by admin.
Messages (5) | ||
---|---|---|
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 | ||
msg107970 - (view) | Author: Terry J. Reedy (terry.reedy) * ![]() |
Date: 2010-06-17 00:34 |
While it could be argued that it is 'obvious' that changing the stdin, stdout, stderr, and pid of a processes cannot work, I agree that a small addition would be good. In 17.1.2. Popen Objects, after "The following attributes are also available", insert " (do not try to change them)" before ':'. Actually, it seems to me that the attributes should actually be read-only (in 3.2) if possible (via custom Popen.__setattr__), in which case the only doc change needed (for 3.2) would be insertion of 'read-only' before 'attributes'. Georg, if you know the id of the subprocess maintainer (if there is one now), could you add him to the nosy list for an opinion or comment? | ||
msg107976 - (view) | Author: Legoll Vincent (vlegoll) | Date: 2010-06-17 01:10 |
On Thu, Jun 17, 2010 at 2:34 AM, Terry J. Reedy <report@bugs.python.org> wrote: > While it could be argued that it is 'obvious' What is obvious for someone maybe is not for others, if I tried to modify it, that was on the (false) assumption that it will do what I wanted (whatever that is)... Adding more precision to documentation or making the interface fool proof will make life of dumb devs like me easier by not having to guess or try. Thanks for taking care of this. | ||
msg281545 - (view) | Author: Mohammad Maaz Khan (maaz92) | Date: 2016-11-23 08:44 |
Hi, I want to update the doc for this. This will be my first attempt to update the documentation. | ||
msg407713 - (view) | Author: Irit Katriel (iritkatriel) * ![]() |
Date: 2021-12-05 15:57 |
The situation is the same in 3.11, both doc and implementation. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:56:38 | admin | set | github: 47937 |
2021-12-05 15:57:52 | iritkatriel | set | nosy: + iritkatrielmessages: + versions: + Python 3.9, Python 3.10, Python 3.11, - Python 2.7, Python 3.5, Python 3.6, Python 3.7 |
2016-12-06 00:26:48 | martin.panter | set | stage: needs patchversions: + Python 3.5, Python 3.6, Python 3.7, - Python 2.6, Python 3.1, Python 3.2 |
2016-11-23 08:44:48 | maaz92 | set | nosy: + maaz92messages: + |
2010-10-29 10:07:21 | admin | set | assignee: georg.brandl -> docs@python |
2010-06-17 23:59:17 | giampaolo.rodola | set | nosy: + giampaolo.rodola |
2010-06-17 01:10:14 | vlegoll | set | nosy: + vlegollmessages: + |
2010-06-17 00:34:45 | terry.reedy | set | nosy: + terry.reedymessages: + versions: + Python 2.6, Python 3.1, Python 2.7, Python 3.2, - Python 2.5 |
2008-08-26 15:57:45 | vincent.legoll | create |