🐛 修复版本文件读取编码

修复在windows上使用gbk读取造成的问题
This commit is contained in:
molanp 2025-05-12 01:25:20 +08:00 committed by HibiKier
parent e291040859
commit 999351a349

View File

@ -92,7 +92,7 @@ class ApiDataSource:
""" """
version_file = Path() / "__version__" version_file = Path() / "__version__"
if version_file.exists(): if version_file.exists():
if text := version_file.open().read(): if text := version_file.open(encoding="utf-8").read():
return text.replace("__version__: ", "").strip() return text.replace("__version__: ", "").strip()
return "unknown" return "unknown"