From 67d7217af8c85ab069169184ccfa891084a9ef0b Mon Sep 17 00:00:00 2001 From: SimonHertoge Date: Thu, 4 Aug 2022 17:10:25 +0200 Subject: [PATCH] Fixed terminaltables IndexError --- viper/common/out.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/viper/common/out.py b/viper/common/out.py index 80a923224..b2c212a4a 100644 --- a/viper/common/out.py +++ b/viper/common/out.py @@ -53,7 +53,8 @@ def table(header, rows): a = a.decode('utf-8', 'backslashreplace') if not isinstance(a, six.text_type): a = six.text_type(a) - to_append.append(a.replace('\t', ' ').replace('\v', '\\v')) + # Prevents terminaltables from parsing escape characters + to_append.append(a.replace('\t', ' ').replace('\v', '\\v').replace('\f', '\\f').replace('\r', '\\r').replace('\n', '\\n')) content.append(to_append) t = AsciiTable(content) if not t.ok: