Message341045
| Author |
scoder |
| Recipients |
cbz, christian.heimes, effbot, eli.bendersky, flox, loewis, scoder, serhiy.storchaka, vstinner |
| Date |
2019年04月29日.06:56:16 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1556520976.81.0.977045928207.issue13611@roundup.psfhosted.org> |
| In-reply-to |
| Content |
Playing around with it a bit more, I ended up changing the interface of the canonicalize() function to return its output as a string by default. It's really nice to be able to say
c14n_xml = canonicalize(plain_xml)
To write to a file, you now do this:
with open("c14n_output.xml", mode='w', encoding='utf-8') as out_file:
canonicalize(xml_data, out=out_file)
and to read from a file:
canonicalize(from_file=fileobj)
I think that nicely handles all use cases. |
|