fix: 修复windows系统下编码格式导致的无法生成文件异常

This commit is contained in:
carolcoral 2024-05-20 20:13:33 +08:00
parent 9188d7d7b1
commit 14fdb7eba8

View File

@ -46,7 +46,7 @@ class Make:
else:
value = doc.createTextNode(str(self.data[key]))
key_node.appendChild(value)
f = open(file=self.xml_path, mode="w")
f = open(file=self.xml_path, mode="w", encoding='UTF8')
python_version = sys.version_info.minor
if 8 == python_version:
doc.writexml(writer=f, addindent=" ", newl="\n", encoding="utf-8")