This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author scoder
Recipients Mariatta, dfrojas, eli.bendersky, lukasz.langa, matrixise, mdk, nedbat, rhettinger, scoder, serhiy.storchaka, sivert, taleinat
Date 2019-03-31.09:47:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1554025678.36.0.0576495837309.issue34160@roundup.psfhosted.org>
In-reply-to
Content
Thanks to the discussion that rhettinger triggered on python-dev, it seems that there is a majority accordance for considering the previous ordering "undefined but deterministic" rather than "sorted", and for making the change from "arbitrarily sorted" to "user defined" in Py3.8. That matches the current status after the merge of the four pull requests, for both ElementTree and MiniDOM.

There also seems to be a large fraction of participants that would like to see a stdlib way to safely/correctly/easily compare XML output. IMHO, that is covered by issue13611, adding a C14N module to ElementTree. There is also a (Py2) C14N implementation for minidom, from the now unmaintained PyXML package¹, which, according to the license, is already distributed under Python copyright. I will try to bring at least the ET module in shape for integration before 3.8 beta1.

During the discussions, several ways were shown to achieve deterministic behaviour, also across Python releases. My proposal is therefore to *not* add a new "sort_attrs" option to the API, with the reasoning that it is a) not required for any of the use cases, b) not maintaining compatibility without code changes (neither backwards nor forward), and c) not what most people actually want who strive for deterministic output. Instead, I think we should concentrate on providing and documenting better ways to compare XML output.

¹ https://github.com/actmd/PyXML/blob/97f144152878a67cd95dd229fe72e86f19bce706/xml/dom/ext/c14n.py
History
Date User Action Args
2019-03-31 09:47:58scodersetrecipients: + scoder, rhettinger, taleinat, nedbat, eli.bendersky, lukasz.langa, serhiy.storchaka, matrixise, sivert, mdk, Mariatta, dfrojas
2019-03-31 09:47:58scodersetmessageid: <1554025678.36.0.0576495837309.issue34160@roundup.psfhosted.org>
2019-03-31 09:47:58scoderlinkissue34160 messages
2019-03-31 09:47:58scodercreate