[Python-Dev] Is XML serialization output guaranteed to be bytewise identical forever?

Serhiy Storchaka storchaka at gmail.com
Tue Mar 19 04:13:00 EDT 2019


19.03.19 00:41, Raymond Hettinger пише:
> 3) Add a standards compliant canonicalization tool (see https://en.wikipedia.org/wiki/Canonical_XML ).  This is likely to be the right-way-to-do-it but takes time and energy.
> 
> 4) Fix the tests in the third-party modules to be more focused on their actual test objectives, the semantics of the generated XML rather than the exact serialization.  This option would seem like the right-thing-to-do but it isn't trivial because the entire premise of the existing test is invalid.  For every case, we'll actually have to think through what the test objective really is.

I think the combination of options 3 and 4 is the right thing. Not 
always the stable output is needed, in these cases option 4 should be 
considered. But there are valid use cases for the stable output, in 
these cases we need to provide an alternative in the stdlib. I am 
working on this.



More information about the Python-Dev mailing list