From 6631c56e6490c6e38bd4ed7dfc50a0f69c04f56b Mon Sep 17 00:00:00 2001 From: Peter Foley Date: Mon, 8 Feb 2016 00:52:04 -0500 Subject: [PATCH] strip color codes --- cslbot/helpers/misc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cslbot/helpers/misc.py b/cslbot/helpers/misc.py index 722d43842..597427bd8 100644 --- a/cslbot/helpers/misc.py +++ b/cslbot/helpers/misc.py @@ -58,7 +58,9 @@ def do_pull(srcdir=None, repo=None): else: proc = subprocess.run(['pip', 'install', '--no-deps', '-U', 'git+git://github.com/%s' % repo], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=os.environ.copy(), universal_newlines=True, check=True) - return proc.stdout.splitlines()[-1] + output = proc.stdout.splitlines()[-1] + # Strip ascii color codes + return re.sub(r'\x1b[^m]*h', '', output) except subprocess.CalledProcessError as e: for line in e.output.decode().splitlines(): logging.error(line)