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, matrixise, nedbat, rhettinger, scoder, serhiy.storchaka, sivert, taleinat, vstinner
Date 2019-03-16.21:27:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1552771637.82.0.494797966066.issue34160@roundup.psfhosted.org>
In-reply-to
Content
Something like this:

def sort_attributes(root):
    for el in root.iter():
        attrib = el.attrib
        if len(attrib) > 1:
            attribs = sorted(attrib.items())
            attrib.clear()
            attrib.update(attribs)
History
Date User Action Args
2019-03-16 21:27:17scodersetrecipients: + scoder, rhettinger, vstinner, taleinat, nedbat, eli.bendersky, serhiy.storchaka, matrixise, sivert, Mariatta, dfrojas
2019-03-16 21:27:17scodersetmessageid: <1552771637.82.0.494797966066.issue34160@roundup.psfhosted.org>
2019-03-16 21:27:17scoderlinkissue34160 messages
2019-03-16 21:27:17scodercreate