When you start a windows executable using subprocess.Popen in shell mode and kill it (instead of letting the exe finish running), the executable remains locked for as long as the python program is running. This doesn't happen when shell=False. Anyone know a solution for this?
import time
import subprocess
proc = subprocess.Popen(r"path_to_executable", shell=True)
time.sleep(1)
proc.terminate() #or kill()
proc = None
# the executable will be locked for the next 100 secs
time.sleep(100)