From cb9d53c615c0d64ba7643f3adb94a59ebe378e63 Mon Sep 17 00:00:00 2001 From: Kushal Das Date: Wed, 25 Apr 2018 11:24:32 -0700 Subject: [PATCH] Fixes #3308 strips out any ANSI escape sequence --- journalist_gui/journalist_gui/SecureDropUpdater.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/journalist_gui/journalist_gui/SecureDropUpdater.py b/journalist_gui/journalist_gui/SecureDropUpdater.py index 279b869e880..80bcda4dd3a 100644 --- a/journalist_gui/journalist_gui/SecureDropUpdater.py +++ b/journalist_gui/journalist_gui/SecureDropUpdater.py @@ -3,12 +3,14 @@ from PyQt5.QtCore import QThread, pyqtSignal import subprocess import os +import re import pexpect from journalist_gui import updaterUI, strings, resources_rc # noqa LOCK_LOCATION = "/home/amnesia/Persistent/securedrop/securedrop_update.lock" # noqa +ESCAPE_POD = re.compile(r'\x1B\[[0-?]*[ -/]*[@-~]') class SetupThread(QThread): @@ -120,7 +122,7 @@ def run(self): self.update_success = False self.failure_reason = strings.tailsconfig_failed_generic_reason result = {'status': self.update_success, - 'output': self.output, + 'output': ESCAPE_POD.sub('', self.output), 'failure_reason': self.failure_reason} self.signal.emit(result)