This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.moore
Recipients gregory.p.smith, milko.krachounov, paul.moore
Date 2010-12-04.23:14:57
SpamBayes Score 1.4097923e-10
Marked as misclassified No
Message-id <1291504501.86.0.656498183639.issue7213@psf.upfronthosting.co.za>
In-reply-to
Content
This bug appears to be Unix-only. On Windows:

>>> from subprocess import *
>>> p1 = Popen(['cat'], stdin=PIPE, stdout=PIPE)
>>> p2 = Popen(['grep', 'a'], stdin=p1.stdout, stdout=PIPE)
>>> p1.stdin.write("aaaaaaaaaaaaaaaa\n")
>>> p1.stdin.close()
>>> p2.stdout.read()
'aaaaaaaaaaaaaaaa\n'
>>>

So there's no clear reason why the default should change on Windows. (It's not possible to specify close_fds explicitly on Windows for this case:

>>> p1 = Popen(['cat'], stdin=PIPE, stdout=PIPE, close_fds=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Apps\Python27\lib\subprocess.py", line 630, in __init__
    raise ValueError("close_fds is not supported on Windows "
ValueError: close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr

which may imply that False is not only reasonable, but necessary on Windows. I haven't dug into this enough to know for sure if this is the case, though).
History
Date User Action Args
2010-12-04 23:15:01paul.mooresetrecipients: + paul.moore, gregory.p.smith, milko.krachounov
2010-12-04 23:15:01paul.mooresetmessageid: <1291504501.86.0.656498183639.issue7213@psf.upfronthosting.co.za>
2010-12-04 23:14:57paul.moorelinkissue7213 messages
2010-12-04 23:14:57paul.moorecreate