[issue34160] ElementTree not preserving attribute order

Stefan Behnel report at bugs.python.org
Fri Nov 16 09:04:22 EST 2018


Stefan Behnel <stefan_ml at behnel.de> added the comment:

> Maybe some people prefer sorting to get a more deterministic output

Note that those people are much better off with C14N. It is the one tool designed for all of these use cases, even usable for cryptographic signatures. And it's trivial to use, it's just a different serialiser.

The new option would only be for people who want the old behaviour for backwards compatibility reasons, like Ned who wants to keep his existing byte level tests working that were created by the previous version. Understandable, although re-serialising the test samples with C14N would probably still be the better approach, because it guards against more than just changes in the attribute order.

Maybe it's time to think about adding the ET C14N module to the stdlib again, see issue13611.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34160>
_______________________________________


More information about the Python-bugs-list mailing list