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

Antoine Pitrou solipsis at pitrou.net
Tue Mar 19 08:50:56 EDT 2019


Hi Raymond,

As long as the new serialization order is deterministic (i.e. it's the
same every run and doesn't depend on e.g. hash randomization), then I
think it's fine to change it.

Some more comments / questions:

> 2). Go into every XML module and add attribute sorting options to each function that generate xml.

What do you mean with "every XML module"? Are there many of them?

> Regardless of option chosen, we should make explicit whether on not the Python standard library modules guarantee cross-release bytewise identical output for XML.

IMO we certainly shouldn't.  XML is a serialization format used for
machine interoperability (even though "human-editable" was one of its
selling points at the start, rather misguidingly).  However, the output
should ideally be stable and deterministic accross all releases of a
given bugfix branch.

(i.e., if I run the same code multiple times on all 3.7.x versions, I
should get always the same output)

Regards

Antoine.




More information about the Python-Dev mailing list