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 eryksun
Recipients deleted-user-7BsjxvvFYDdTwO8F, eryksun, veky
Date 2021-08-29.22:50:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1630277418.16.0.729633870024.issue45048@roundup.psfhosted.org>
In-reply-to
Content
The documentation states that "[i]f capture_output is true, stdout and stderr will be captured". This implies a container of some kind. So look to what subprocess.run() returns: "[w]ait for command to complete, then return a CompletedProcess instance". The `stdout` attribute of a CompletedProcess is the "[c]aptured stdout from the child process". 

For example:

    >>> p = subprocess.run("dir", shell=True, capture_output=True)
    >>> p.stdout[:18]
    b' Volume in drive C'

If the output is not captured, the child process inherits the standard output/error files of the parent process, which is typically a console or terminal.

FYI, the `dir` command is internal to the CMD shell in Windows, so it only works with shell=True. There is no "dir.exe" executable that can be executed with shell=False.
History
Date User Action Args
2021-08-29 22:50:18eryksunsetrecipients: + eryksun, veky, deleted-user-7BsjxvvFYDdTwO8F
2021-08-29 22:50:18eryksunsetmessageid: <1630277418.16.0.729633870024.issue45048@roundup.psfhosted.org>
2021-08-29 22:50:18eryksunlinkissue45048 messages
2021-08-29 22:50:18eryksuncreate