From f28b91499e6e82daeacc9d8c9acbfdfc639f86f1 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 10 Oct 2019 15:01:00 -0400 Subject: [PATCH] Fix console replay with formatting Bold and related items would trigger a problem with python3 --- confluent_server/confluent/consoleserver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/consoleserver.py b/confluent_server/confluent/consoleserver.py index 4eb177b9..51853100 100644 --- a/confluent_server/confluent/consoleserver.py +++ b/confluent_server/confluent/consoleserver.py @@ -106,7 +106,7 @@ def pytechars2line(chars, maxlen=None): len = 1 for charidx in range(maxlen): char = chars[charidx] - csi = [] + csi = bytearray([]) if char.fg != lfg: csi.append(30 + pytecolors2ansi[char.fg]) lfg = char.fg @@ -129,7 +129,7 @@ def pytechars2line(chars, maxlen=None): lr = char.reverse csi.append(7 if lr else 27) if csi: - line += b'\x1b[' + b';'.join(['{0}'.format(x) for x in csi]) + b'm' + line += b'\x1b[' + b';'.join(['{0}'.format(x).encode('utf-8') for x in csi]) + b'm' if not hasdata and char.data.rstrip(): hasdata = True chardata = char.data