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.

classification
Title: subprocess: feature request: Get only the stdout of the last shell command
Type: enhancement Stage: resolved
Components: Library (Lib) Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: Riccardo La Marca, altendky, christian.heimes, monkeyman79, paul.j3, paul.moore, r.david.murray, serhiy.storchaka, steve.dower, tim.golden, v+python, zach.ware
Priority: normal Keywords:

Created on 2021-01-29 14:07 by Riccardo La Marca, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg385909 - (view) Author: Riccardo La Marca (Riccardo La Marca) Date: 2021-01-29 14:07
This is a link with some examples of the required functionality:
https://stackoverflow.com/questions/65952314
msg385910 - (view) Author: Kyle Altendorf (altendky) * Date: 2021-01-29 14:30
I'm not sure why I got added...  but as mentioned in the SO response, this isn't how stuff works.  Python isn't monitoring what subprocesses are created in the tree below the one Python itself creates nor does it have any way to know which line of which subprocess is creating any given output.
msg385911 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-01-29 14:33
Please provide all information for your feature request in this ticket. We like to keep and archive all steps of the decision process in the same place. We also don't do stackoverflow-driven development.
msg385912 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2021-01-29 14:38
This has nothing to do with python other than the fact that you are using it to capture stdout.  You have to figure out how to get the output you want to be what shows up on stdout, python has no knowledge of what commands you put in your shell script, and it *cannot* have any knowledge of that.  I think you need to learn more about basic shell scripting and unix pipelines and how stdout works.

Also note that making people nosy on an issue is not a good idea if you are not part of the triage team.  You should leave that for the bug triage people to do, as they know who's attention on the issue will be most useful.  In the future when you open an issue please simply wait a while for a response.
History
Date User Action Args
2022-04-11 14:59:40adminsetgithub: 87227
2021-01-29 15:59:27vstinnersetnosy: - vstinner
2021-01-29 14:38:17r.david.murraysetstatus: open -> closed
versions: - Python 3.10
messages: + msg385912

resolution: rejected
stage: resolved
2021-01-29 14:33:34christian.heimessetcomponents: + Library (Lib)
versions: + Python 3.10, - Python 3.8
2021-01-29 14:33:04christian.heimessetnosy: + christian.heimes
messages: + msg385911
2021-01-29 14:30:52altendkysetmessages: + msg385910
2021-01-29 14:15:09Riccardo La Marcasetnosy: + paul.moore, vstinner, tim.golden, zach.ware, serhiy.storchaka, steve.dower, altendky
2021-01-29 14:11:58Riccardo La Marcasetnosy: + v+python, r.david.murray, paul.j3, monkeyman79
2021-01-29 14:07:35Riccardo La Marcacreate