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 bagratte
Recipients bagratte
Date 2014-01-09.01:35:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1389231308.67.0.0933451284696.issue20198@psf.upfronthosting.co.za>
In-reply-to
Content
xml.etree.ElementTree.ElementTree.write method (and, as a derivative, xml.etree.ElementTree.tostring function) sorts attributes in lexical order. while an admissible behavior instead of the randomness inherited from ordinary dict, this prevents a picky user to have her own custom ordering by passing an OrderedDict to Element, SubElement and the like (i guess there are none). that is to say:

if
-----------------------------------
e = Element("tag", OrderedDict([("a", "a"), ("c", "c"), ("b", "b")]))
-----------------------------------
then both
-----------------------------------
tostring(e)
ElementTree(e).write("xml.xml")
-----------------------------------
will result in
-----------------------------------
<tag a="a" b="b" c="c" />
-----------------------------------
while the intention of the user was
-----------------------------------
<tag a="a" c="c" b="b" />
History
Date User Action Args
2014-01-09 01:35:08bagrattesetrecipients: + bagratte
2014-01-09 01:35:08bagrattesetmessageid: <1389231308.67.0.0933451284696.issue20198@psf.upfronthosting.co.za>
2014-01-09 01:35:08bagrattelinkissue20198 messages
2014-01-09 01:35:06bagrattecreate