Browse Source

fix: read source.json with utf-8

master
lanvent 1 year ago
parent
commit
c9306633b2
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      plugins/plugin_manager.py

+ 2
- 2
plugins/plugin_manager.py View File

@@ -220,7 +220,7 @@ class PluginManager:
if not match: if not match:
try: try:
with open("./plugins/source.json","r") as f:
with open("./plugins/source.json","r", encoding="utf-8") as f:
source = json.load(f) source = json.load(f)
if repo in source["repo"]: if repo in source["repo"]:
repo = source["repo"][repo]["url"] repo = source["repo"][repo]["url"]
@@ -238,7 +238,7 @@ class PluginManager:
if os.path.exists(os.path.join(dirname,"requirements.txt")): if os.path.exists(os.path.join(dirname,"requirements.txt")):
logger.info("detect requirements.txt,installing...") logger.info("detect requirements.txt,installing...")
pkgmgr.install_requirements(os.path.join(dirname,"requirements.txt")) pkgmgr.install_requirements(os.path.join(dirname,"requirements.txt"))
return True, "安装插件成功,请使用#scanp命令扫描插件或重启程序"
return True, "安装插件成功,请使用 #scanp 命令扫描插件或重启程序"
except Exception as e: except Exception as e:
logger.error("Failed to install plugin, {}".format(e)) logger.error("Failed to install plugin, {}".format(e))
return False, "安装插件失败,"+str(e) return False, "安装插件失败,"+str(e)


Loading…
Cancel
Save