encode xml

FossilOrigin-Name: fb4563f3b117dfdd0be637c93efe2197bb49d15a436d882b4ad650b681c205b3
This commit is contained in:
alnus@disroot.org 2020-10-31 03:29:32 +00:00
parent b024533934
commit 5315a7fab9

View File

@ -9,7 +9,7 @@ def DIANWrite(xml, filename):
def DIANWriteSigned(xml, filename, private_key, passphrase, use_cache_policy=False):
document = xml.tostring(xml_declaration=True, encoding='UTF-8')
document = xml.tostring(xml_declaration=True, encoding='UTF-8').encode('utf-8')
signer = fe.DianXMLExtensionSigner(private_key, passphrase=passphrase, mockpolicy=use_cache_policy)
with open(filename, 'w') as f:
f.write(signer.sign_xml_string(document))