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 serhiy.storchaka
Recipients eli.bendersky, rhettinger, scoder, serhiy.storchaka
Date 2018-07-20.04:46:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Attributes are sorted by name when converted an element to the text representation for making it stable. Changing this may break existing software.

I think it makes sense now to add an optional keyword-only parameter sort_attrs (True by default) for functions tostring() and tostringlist() and method ElementTree.write(). If it is False, attributes will keep the original order.

Since dump() is used for debugging only, it could change the behavior by default, even in maintained releases. But currently it just uses ElementTree.write(), which should sort attributes by default for compatibility.
Date User Action Args
2018-07-20 04:46:12serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, scoder, eli.bendersky
2018-07-20 04:46:12serhiy.storchakasetmessageid: <>
2018-07-20 04:46:12serhiy.storchakalinkissue34160 messages
2018-07-20 04:46:12serhiy.storchakacreate