parse bytes instead of strings

This commit is contained in:
2026-03-16 07:51:00 +01:00
parent 476730d2d1
commit d044e35901
6 changed files with 16 additions and 23 deletions
+1 -2
View File
@@ -11,8 +11,7 @@ class MsgReceiver(MsgSink):
def is_msg(self, msg: MsgContainer):
res = False
try:
data = msg.data.decode(encoding="utf-8")
res = re.match(self.filter, data) is not None
res = re.match(bytes(self.filter, encoding="utf-8"), msg.data) is not None
except UnicodeDecodeError:
pass
return res