Re: threads and os.spawnlp on Linux
by Ram other posts by this author
Jul 1 2003 4:31PM messages near this date
Python -> To Exe or/and Elf
|
Python 2.0 / Python 2.2
Some more info to add on ... the problem seems that if some system
call fails (or times out) in the os.system or os.spawnlp, then it
never returns back the execution context.
The following also causes similar results as before if the IP address
pinged is unreachable, but if it is a reachable IP, it returns
correctly. The problem occurs only if the os.system is inside the
thread class.
import os
import threading
import time
class Child(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
# Pinging some unreachable IP
os.system("ping -c 2 192.168.1.55")
print "done"
if __name__ == '__main__':
t = Child()
t.start()
Thanks
Ram
--
http://mail.python.org/mailman/listinfo/python-list
|