From bb65dedf8ee79b5c2aab26acffaadd1b35306271 Mon Sep 17 00:00:00 2001 From: adnan-tex <66623105+adnan-tex@users.noreply.github.com> Date: Thu, 25 May 2023 20:37:19 +0600 Subject: [PATCH] Update base.py --- zk/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zk/base.py b/zk/base.py index 4940d09..6e3d6bb 100644 --- a/zk/base.py +++ b/zk/base.py @@ -187,7 +187,7 @@ def __create_header(self, command, command_string, session_id, reply_id): """ Puts a the parts that make up a packet together and packs them into a byte string """ - buf = pack('<4H', command, 0, session_id, reply_id) + command_string + buf = pack('<4H', command, 0, session_id, reply_id) + command_string.encode('utf-8') buf = unpack('8B' + '%sB' % len(command_string), buf) checksum = unpack('H', self.__create_checksum(buf))[0] reply_id += 1 @@ -195,7 +195,7 @@ def __create_header(self, command, command_string, session_id, reply_id): reply_id -= const.USHRT_MAX buf = pack('<4H', command, checksum, session_id, reply_id) - return buf + command_string + return buf + command_string.encode('utf-8') def __create_checksum(self, p): """