> I am just playing around with threading and subprocess and found that > the following program will hang up and never terminate every now and > again. > > import threading > import subprocess > import time > > def targ(): > p = subprocess.Popen(["/bin/sleep", "2"]) > while p.poll() is None: > time.sleep(1) > > t1 = threading.Thread(target=targ) > t2 = threading.Thread(target=targ) > t1.start() > t2.start() > > t1.join() > t2.join() > > > I found this bug, and while it sounds similar it seems that it was > closed during python 2.5 (I'm using 2.7.2): > http://bugs.python.org/issue1404925
I can confirm hanging on my installation of 2.7.2. I also ran this code 100 times on 3.2.2 without experiencing a hang. Is version 3.x a possibility for you? -- http://mail.python.org/mailman/listinfo/python-list