From 6614f6ce4322d6f4380cfbce367c6c330c6f8286 Mon Sep 17 00:00:00 2001 From: Jared Dulmage Date: Tue, 5 May 2020 22:56:50 -0600 Subject: [PATCH] Convert sbs message to bytes before sending --- python/sbs1.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/sbs1.py b/python/sbs1.py index c3a4bd3..a275a63 100644 --- a/python/sbs1.py +++ b/python/sbs1.py @@ -93,8 +93,9 @@ class output_sbs1: try: sbs1_msg = self.parse(msg) if sbs1_msg is not None: + sbs1_bytes = sbs1_msg.encode('utf-8') for conn in self._conns[:]: #iterate over a copy of the list - conn.send(sbs1_msg) + conn.send(sbs1_bytes) except socket.error: self._conns.remove(conn) print("Connections: ", len(self._conns))