From c9306633b2f9a4dfed37e33861652c28011119fc Mon Sep 17 00:00:00 2001 From: lanvent Date: Fri, 7 Apr 2023 01:15:31 +0800 Subject: [PATCH] fix: read source.json with utf-8 --- plugins/plugin_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/plugin_manager.py b/plugins/plugin_manager.py index 9856e34..89eb996 100644 --- a/plugins/plugin_manager.py +++ b/plugins/plugin_manager.py @@ -220,7 +220,7 @@ class PluginManager: if not match: try: - with open("./plugins/source.json","r") as f: + with open("./plugins/source.json","r", encoding="utf-8") as f: source = json.load(f) if repo in source["repo"]: repo = source["repo"][repo]["url"] @@ -238,7 +238,7 @@ class PluginManager: if os.path.exists(os.path.join(dirname,"requirements.txt")): logger.info("detect requirements.txt,installing...") pkgmgr.install_requirements(os.path.join(dirname,"requirements.txt")) - return True, "安装插件成功,请使用#scanp命令扫描插件或重启程序" + return True, "安装插件成功,请使用 #scanp 命令扫描插件或重启程序" except Exception as e: logger.error("Failed to install plugin, {}".format(e)) return False, "安装插件失败,"+str(e)