From 064b30eb95923ba67187ec623890c01fecf1e38b Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 2 Sep 2025 16:53:30 +0800 Subject: [PATCH] bugfix --- uapi/appapi.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/uapi/appapi.py b/uapi/appapi.py index a3f8b7d..42a9786 100644 --- a/uapi/appapi.py +++ b/uapi/appapi.py @@ -171,10 +171,14 @@ class UAPI: gen = liner(self.__call__(upappid, apiname, callerid, params=params)) async for line in gen: filter = self.uapi.chunk_match + if filter: + filter = filter.encode('utf-8') + else: + filter = b'' if line.startswith(filter): line = line[len(filter):] if self.uapi.response: - dic = json.loads(line) + dic = json.loads(line.decode('utf-8') line = self.rendertmpl(self.uapi.response, dic) yield line + '\n' else: