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 towb
Recipients towb
Date 2014-10-13.11:16:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
This generates an XML declaration:

    import xml.etree.ElementTree as ET

    root = ET.Element('rss', version='2.0')
    tree = ET.ElementTree(root)
    tree.write('test.xml', encoding='iso-8859-1', xml_declaration=True)

However the declaration disappears if your don't pass an encoding. This doesn't match the documentation:

    xml_declaration controls if an XML declaration should be added to the file. Use False for never, True for always, None for only if not US-ASCII or UTF-8 or Unicode (default is None).
Date User Action Args
2014-10-13 11:16:08towbsetrecipients: + towb
2014-10-13 11:16:08towbsetmessageid: <>
2014-10-13 11:16:08towblinkissue22622 messages
2014-10-13 11:16:08towbcreate