8000 [pull] master from shmilylty:master by pull[bot] · Pull Request #5 · xzy012/OneForAll · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ def save_to_file(path, data):
:return: 保存成功与否
"""
try:
with open(path, 'w', errors='ignore', newline='') as file:
with open(path, 'w', errors='ignore', newline='', encoding='utf-8') as file:
file.write(data)
return True
except TypeError:
with open(path, 'wb') as file:
with open(path, 'wb', encoding='utf-8') as file:
file.write(data)
return True
except Exception as e:
Expand Down
Loading
0