pyinvoke / invoke

Pythonic task management & command execution.
http://pyinvoke.org
BSD 2-Clause "Simplified" License
4.31k stars 365 forks source link

#486 Fix sudo hangs on second run #898

Open nelsyeung opened 1 year ago

nelsyeung commented 1 year ago

Fixes #486

The process stays alive after the sudo fail attempt (because it'll ask for the password again, so the process will wait for another stdin), so we must terminate it. Any subsequent use of subprocess.PIPE for stdin will be blocked otherwise.