Spaces:
Sleeping
Sleeping
iHomeSoft commited on
Commit ·
d535925
1
Parent(s): ab6c9c5
修复Windows系统读取`auth.json`可能的编码报错问题 (#344)
Browse files- ChuanhuChatbot.py +1 -1
ChuanhuChatbot.py
CHANGED
|
@@ -44,7 +44,7 @@ else:
|
|
| 44 |
with open("api_key.txt", "r") as f:
|
| 45 |
my_api_key = f.read().strip()
|
| 46 |
if os.path.exists("auth.json"):
|
| 47 |
-
with open("auth.json", "r") as f:
|
| 48 |
auth = json.load(f)
|
| 49 |
username = auth["username"]
|
| 50 |
password = auth["password"]
|
|
|
|
| 44 |
with open("api_key.txt", "r") as f:
|
| 45 |
my_api_key = f.read().strip()
|
| 46 |
if os.path.exists("auth.json"):
|
| 47 |
+
with open("auth.json", "r", encoding='utf-8') as f:
|
| 48 |
auth = json.load(f)
|
| 49 |
username = auth["username"]
|
| 50 |
password = auth["password"]
|