Skip to content
This repository was archived by the owner on Nov 28, 2024. It is now read-only.

IndexError with ANSI codes #75

@sergehauri

Description

@sergehauri

In the expect method, when self.current_output is still empty and current_buffer_decoded is 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions