From 781dd99ab6a59d124b589a12e2b8a06f6240b2b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Wed, 31 Aug 2022 15:27:14 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E8=AF=BB?= =?UTF-8?q?=E5=86=99=E7=BC=93=E5=AD=98=E6=97=B6=E6=B2=A1=E6=9C=89=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/wiki/cache.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/wiki/cache.py b/core/wiki/cache.py index 752ca697..1b2498d1 100644 --- a/core/wiki/cache.py +++ b/core/wiki/cache.py @@ -23,7 +23,9 @@ class WikiCache: async def get(self, key: str) -> dict: qname = f"{self.qname}:{key}" - result = json.loads(await self.client.get(qname)) + data = await self.client.get(qname) + json_data = str(data, encoding="utf-8") + result = json.loads(json_data) if isinstance(result, list) and len(result) > 0: for num, item in enumerate(result): result[num] = json.loads(item)