New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Popen(..., shell=True,...) should allow simple access to the command's PID #49105
Comments
When using proc = Popen() with the parameter "shell=True", the returned This gets very cumbersome, when the newly created process shall be Moreover, sending a signal to the shell does (for some reason) not get Using 'shell=False' is not an option in case the originating process Starting another thread with fork() is also not an option, as the Popen All examples I found on the net which use pipes to communicate between So, there should be one of these alternative possibilities/behaviours
...with 1) being the most up to 4) being the least desireable. I hope I did not overlook any such possibility, but searching around on I really do think this should be more intuitive. |
This really belongs to python-list rather than the tracker. It is not It is not clear what you are trying to achieve. Here is an example >>> from subprocess import *
>>> p = Popen(['sleep', '10000'])
>>> p.kill()
>>> p.wait()
-9 or using a different signal (SIGINT = 2): >>> p = Popen(['sleep', '10000'])
>>> p.send_signal(2)
>>> p.wait()
-2 The wait function blocks until the process terminates and returns the Your proposals don't make much sense:
In short, this report is invalid. |
As Alexander says: a shell command can spawn any number of subprocesses, |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: