Re: SIGALRM problem

2008-10-13 Thread Paul Rubin
Mike Driscoll <[EMAIL PROTECTED]> writes: > http://mail.python.org/pipermail/python-list/2003-August/217530.html > It's old, but it looks ok... Thanks. Maybe I did a dumb thing by overloading IOError and os.popen is actually catching that exception for purposes of its own. I'll try making a new

Re: SIGALRM problem

2008-10-13 Thread Mike Driscoll
On Oct 13, 11:45 am, Paul Rubin wrote: > I'm trying to run a command on a remote host, something like: > >    result = os.popen('ssh otherhost mycommand').read() > > It is possible that the other host is down, in which case the ssh > command hangs, so I want my script to

SIGALRM problem

2008-10-13 Thread Paul Rubin
I'm trying to run a command on a remote host, something like: result = os.popen('ssh otherhost mycommand').read() It is possible that the other host is down, in which case the ssh command hangs, so I want my script to time out if this happens: def timeout(*x): raise IOError, 'timeout