The subprocess.Popen() object documentation should indicate
that the stdout attribute should not be modified after
object construction. Because that won't work.
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?
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.
Activity
vincentlegoll commented on Aug 26, 2008
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
This blocks forever
terryjreedy commented on Jun 17, 2010
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?
vlegoll commented on Jun 17, 2010
On Thu, Jun 17, 2010 at 2:34 AM, Terry J. Reedy <report@bugs.python.org> wrote:
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.
maaz92 commented on Nov 23, 2016
Hi, I want to update the doc for this. This will be my first attempt to update the documentation.
iritkatriel commented on Dec 5, 2021
The situation is the same in 3.11, both doc and implementation.
gh-47937: Note that Popen attributes are read-only (#93070)
pythongh-47937: Note that Popen attributes are read-only (pythonGH-93070
pythongh-47937: Note that Popen attributes are read-only (pythonGH-93070
pythongh-47937: Note that Popen attributes are read-only (pythonGH-93070
[3.11] gh-47937: Note that Popen attributes are read-only (GH-93070) (#…
[3.10] gh-47937: Note that Popen attributes are read-only (GH-93070) (#…
Merge branch 'main' into inlinecomp2