python pexpect timeout_python pexpect 模块读取H3C交换机配置 TIMEOUT问题求助!

[Python] 纯文本查看 复制代码Traceback (most recent call last):

File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 111, in expect_loop

incoming = spawn.read_nonblocking(spawn.maxread, timeout)

File "/usr/lib/python3/dist-packages/pexpect/pty_spawn.py", line 482, in read_nonblocking

raise TIMEOUT('Timeout exceeded.')

pexpect.exceptions.TIMEOUT: Timeout exceeded.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/home/hrj/PycharmProjects/untitled/test.py", line 40, in

main()

File "/home/hrj/PycharmProjects/untitled/test.py", line 36, in main

child.expect('>')

File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 340, in expect

return self.expect_list(compiled_pattern_list,

File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 369, in expect_list

return exp.expect_loop(timeout)

File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 119, in expect_loop

return self.timeout(e)

File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 82, in timeout

raise TIMEOUT(msg)

pexpect.exceptions.TIMEOUT: Timeout exceeded.

command: /usr/bin/ssh

args: ['/usr/bin/ssh', 'admin@172.18.103.10']

buffer (last 100 chars): b'#\r\r\nvlan 101\r\r\n description ILO\r\r\n#\r\r\nvlan 102\r\r\n description CVK_GL\r\r\n#\r\r\nvlan 103\r\r\n---- More ----'

before (last 100 chars): b'#\r\r\nvlan 101\r\r\n description ILO\r\r\n#\r\r\nvlan 102\r\r\n description CVK_GL\r\r\n#\r\r\nvlan 103\r\r\n---- More ----'

after:

match: None

match_index: None

exitstatus: None

flag_eof: False

pid: 2864

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: re.compile(b'>')

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值