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 deleted-user-7BsjxvvFYDdTwO8F
Recipients deleted-user-7BsjxvvFYDdTwO8F
Date 2021-08-29.21:12:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1630271574.19.0.912939412698.issue45048@roundup.psfhosted.org>
In-reply-to
Content
If you run subprocess.run(capture_output=True), it doesn't show output, but if you run subprocess.run(capture_output=False) (or if you just run subprocess.run() since False is default), it does show output. In the example in the docs, it shows this in the examples section:

```py
>>> subprocess.run(["ls", "-l"])  # doesn't capture output
CompletedProcess(args=['ls', '-l'], returncode=0)

>>> subprocess.run(["ls", "-l", "/dev/null"], capture_output=True)
CompletedProcess(args=['ls', '-l', '/dev/null'], returncode=0,
stdout=b'crw-rw-rw- 1 root root 1, 3 Jan 23 16:23 /dev/null\n', stderr=b'')
```

This clearly shows capture_output showing output if true but not if false. Test code:

```py
import subprocess
subprocess.run("dir", shell=True, capture_output=False)
subprocess.run("dir", shell=True, capture_output=False)
```

Other notes: for some reason I get an error if I don't add shell=True, so maybe that contributes? I am on Windows 10 if that matters.
History
Date User Action Args
2021-08-29 21:12:54deleted-user-7BsjxvvFYDdTwO8Fsetrecipients: + deleted-user-7BsjxvvFYDdTwO8F
2021-08-29 21:12:54deleted-user-7BsjxvvFYDdTwO8Fsetmessageid: <1630271574.19.0.912939412698.issue45048@roundup.psfhosted.org>
2021-08-29 21:12:54deleted-user-7BsjxvvFYDdTwO8Flinkissue45048 messages
2021-08-29 21:12:54deleted-user-7BsjxvvFYDdTwO8Fcreate