getstatusoutput() headaches :(

Byrom, R (Rob) R.Byrom at rl.ac.uk
Wed Oct 29 12:43:42 EST 2003


ok i think I have a solution,

rather than than use getstatusoutput() I've used: os.system('/sbin/service
network restart &')

putting the process in the background prevents it from hanging. I guess
something weird was going on when brining up eth0 on my machine (it hangs at
that point). Anyway, any suggestions on whats going on would be good :)

Rob

-----Original Message-----
From: Byrom, R (Rob) [mailto:R.Byrom at rl.ac.uk]
Sent: Wednesday, October 29, 2003 5:00 PM
To: 'python-list at python.org'
Subject: getstatusoutput() headaches :(


hi, 
I'm hoping someone can help me :) 
I'm using the commands module (under linux) to do the following: 
commands.getstatusoutput('/sbin/service network restart') 
this is executed in a separate thread from the main executing thread.
However, the separate thread that executes the above hangs forever. 
When I attempt to run the above without the thread it works ok. Am I doing
something stupid? I'm thinking the thread is unable to access the
stout/stderr stream which causes it to hang but I've tried running other
commands (such as 'ls' and it works ok). 
any help gratefully appreciated, 
Rob b


-- 
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list