python pexpect timeout_Python 的 pexpect 模块的问题
使用這個模塊進行 scp 命令的時候, 因為 ip 不在已知的主機列表中, 所以有一個需要輸入 yes/no 的動作,
The authenticity of host 'X.X.X.X (X.X.X.X)' can't be established.
ECDSA key fingerprint is SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
ECDSA key fingerprint is MD5:67:2a:d8:dc:13:9XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
Are you sure you want to continue connecting (yes/no)?
我的判斷是:
i = child.expect(['denied', 'yes/no', 'assword', '100%'], timeout=10)
但是每次這里的檢測都過不去, 不知道為什么
pexpect.exceptions.TIMEOUT: Timeout exceeded.
command: /usr/bin/scp
args: ['/usr/bin/scp', '/root/.ssh/id_rsa.pub', '[email?protected]:/root/.ssh/authorized_keys']
buffer (last 100 chars): ')? '
before (last 100 chars): ')? '
after:
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 11859
child_fd: 5
closed: False
timeout: 30
delimiter:
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: EOF
總結(jié)
以上是生活随笔為你收集整理的python pexpect timeout_Python 的 pexpect 模块的问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 华为运动健康 App 上线跳绳勋章,3
- 下一篇: 小米推出米家扫拖机器人 3S:3D 立体