problems while using pexpect: pexcept.TIMEOUT always

Phoe6 orsenthil at gmail.com
Mon Jun 8 12:07:49 EDT 2009


I have been trying to use pexpect and I am failing with
pexpect.TIMEOUT for all my attempts. In order to troubleshoot, I
decided to go with simplest possible one.

Here is my ssh to localhost:

[21:29:14 senthil]$ssh localhost -l senthil
senthil at localhost's password:
senthil at ubuntu:~$

And here is my pexpect script:

http://paste.pocoo.org/show/121788/

And the output I get is:

True
None
None
Traceback (most recent call last):
  File "4.py", line 17, in <module>
    print child.read()
  File "/usr/local/lib/python2.6/site-packages/pexpect.py", line 858,
in read
    self.expect (self.delimiter) # delimiter default is EOF
  File "/usr/local/lib/python2.6/site-packages/pexpect.py", line 1311,
in expect
    return self.expect_list(compiled_pattern_list, timeout,
searchwindowsize)
  File "/usr/local/lib/python2.6/site-packages/pexpect.py", line 1325,
in expect_list
    return self.expect_loop(searcher_re(pattern_list), timeout,
searchwindowsize)
  File "/usr/local/lib/python2.6/site-packages/pexpect.py", line 1409,
in expect_loop
    raise TIMEOUT (str(e) + '\n' + str(self))
pexpect.TIMEOUT: Timeout exceeded in read_nonblocking().

Complete Traceback is here:
http://paste.pocoo.org/show/121790/

Can someone help me what I am doing wrong here?
Why is not working for such a simple thing as ssh to my localhost.?

I am getting the same problem while trying to login to remote host
also.

Thanks,
Senthil



More information about the Python-list mailing list