当前位置: 首页 > python > 正文

pexpect Timeout exceeded in read_nonblocking()

gg resolve from bbs:
vi /usr/lib/python2.6/site-packages/pxssh.py
#add line 134,135:
    123     def synch_original_prompt (self):
    124
    125         “””This attempts to find the prompt. Basically, press enter and record
    126         the response; press enter again and record the response; if the two
    127         responses are similar then assume we are at the original prompt. “””
    128
    129         # All of these timing pace values are magic.
    130         # I came up with these based on what seemed reliable for
    131         # connecting to a heavily loaded machine I have.
    132         # If latency is worse than these values then this will fail.
    133
    134         self.sendline()
    135         time.sleep(0.5)

    136         self.read_nonblocking(size=10000,timeout=1) # GAS: Clear out the cache before getting the prompt
    137         time.sleep(0.1)

we just put something there before ssh expect read.

本文固定链接: https://www.2hei.net/2011/10/24/pexpect_timeout_exceeded/ | 2hei.net

该日志由 u2 于2011年10月24日发表在 python 分类下,
原创文章转载请注明: pexpect Timeout exceeded in read_nonblocking() | 2hei.net

报歉!评论已关闭.