Feature or enhancement
Hi,
I propose to add a subprocess.shell(cmd) function similar to os.system(), but use subprocess: close file descriptors, restore signal handlers, etc. The function runs a shell command and so is vulnerable by design to shell injection vulnerability if an attacker can modify the shell command.
The function accepts keyword arguments: subprocess.shell(cmd, env=env), subprocess.shell(cmd, stdout=subprocess.PIPE), etc.
This proposition is related to os.system() soft deprecation: #120744
What do you think?
Victor
cc @gpshead @zooba
Linked PRs