提交 5f46f764 编写于 作者: F feilong

fix script bug

上级 b0859e9b
# -*- coding: utf-8 -*-
from json import load
from src.tree import TreeWalker, load_json, dump_json
......
# -*- coding: utf-8 -*-
import logging
from genericpath import exists
import json
......@@ -16,7 +17,7 @@ logger.addHandler(handler)
def load_json(p):
with open(p, 'r') as f:
with open(p, 'r', encoding='utf-8') as f:
return json.loads(f.read())
......@@ -29,7 +30,7 @@ def dump_json(p, j, exist_ok=False, override=False):
logger.error(f"{p} already exist")
sys.exit(0)
with open(p, 'w+') as f:
with open(p, 'w+', encoding='utf-8') as f:
f.write(json.dumps(j, indent=2, ensure_ascii=False))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册