trouble with sys.exec and sockets/ssh

Geoff Gerrietts geoff at
Sat Feb 22 01:12:46 CET 2003

Quoting Richard Cook (rcook at
> At 7:52 PM +0000 2/21/03, Donn Cave wrote:
> I knew this question would cause confusion.  Here is my example program:
> import os
> os.execv('ensight7.sos', 'ensight7.sos', '-c', '')

I believe your problem is a consequence of ssh expecting to read and
write to a terminal (tty). I believe if you use the pty module,
pty.spawn() will do what you need. If you need more direct
programmatic control over the spawned creature, I think the pexpect
module ( might give you some quality

I could be mistaken, but this is a problem I have had in the past, and
that's how I resolved it, so if it doesn't work for you, I can only
apologize for your wasted time.


Geoff Gerrietts                                 <geoff at gerrietts net> 
"A man can't be too careful in the choice of his enemies." --Oscar Wilde

More information about the Python-list mailing list