From c533c973b18e3d950ee42bc66354518b54ad3dfe Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 13 Apr 2022 17:00:27 -0400 Subject: [PATCH] Fix python3 compatibility with termhandler --- confluent_client/confluent/termhandler.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/confluent_client/confluent/termhandler.py b/confluent_client/confluent/termhandler.py index c628a0dd..32304aec 100644 --- a/confluent_client/confluent/termhandler.py +++ b/confluent_client/confluent/termhandler.py @@ -53,9 +53,12 @@ class TermHandler(object): connection = None try: connection, address = self.socket.accept() - connection.sendall("confetty control v1--\n") + connection.sendall(b"confetty control v1--\n") cmd = connection.recv(8) - if 'GETWINID' == cmd: + if b'GETWINID' == cmd: + winid = os.environ['WINDOWID'] + if not isinstance(winid, bytes): + winid = winid.encode('utf8') connection.sendall(os.environ['WINDOWID']) connection.close() except BaseException: