In the expect method, when self.current_output is still empty and current_buffer_decodedis empty because the current_buffer only contains an ANSI escape code (and strip_ansi is True), the following exception is raised:
File "/srv/www/rantools/venvs/infenv3/lib/python3.6/site-packages/paramiko_expect.py", line 191, in expect
current_buffer_output_decoded = '\n' + self.current_output.splitlines()[-1]
IndexError: list index out of range
I refrained from setting up a reproducible example because I think the error is easy enough to understand from the code alone. Easiest would probably be to only change current_buffer_output_decoded if self.current_output isn't empty.
In the expect method, when
self.current_output
is still empty andcurrent_buffer_decoded
is empty because thecurrent_buffer
only contains an ANSI escape code (andstrip_ansi
is True), the following exception is raised:I refrained from setting up a reproducible example because I think the error is easy enough to understand from the code alone. Easiest would probably be to only change
current_buffer_output_decoded
ifself.current_output
isn't empty.