Leaks in subprocess.Popen
v.vayer at gmail.com
Wed Sep 20 19:07:07 CEST 2006
I'm using Python 2.4.3 for Win32.
I was trying to run a few child processes simultaneously in separate
threads and get their STDOUT, but the program was leaking memory and I
found that it was because of subprocess operating in another thread.
The following code works fine, but I get a leaking handle every second.
You can see it in the task manager if you choose to see the <handle
count> column. Does anybody have a solution? Please help!
import subprocess, time, thread
run = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
out, err = run.communicate()
More information about the Python-list