From c56bf257ded152dd3d2326d5d7a756cbd59307b3 Mon Sep 17 00:00:00 2001 From: Miedviediev Dmytro Date: Mon, 15 Jul 2024 19:44:07 +0300 Subject: [PATCH] fix reading json string --- asyncmy/replication/packets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asyncmy/replication/packets.py b/asyncmy/replication/packets.py index f39eee1..24d2fda 100644 --- a/asyncmy/replication/packets.py +++ b/asyncmy/replication/packets.py @@ -251,7 +251,7 @@ def read_variable_length_string(self): length = 0 bits_read = 0 while byte & 0x80 != 0: - byte = struct.pack("!B", self.read(1)) + byte = struct.unpack("!B", self.read(1))[0] length = length | ((byte & 0x7F) << bits_read) bits_read = bits_read + 7 return self.read(length)