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 martin.panter
Recipients martin.panter, zimeon
Date 2015-09-18.02:39:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Here is a patch which changes the code to respect the letter case specified by the user, although it still compares the special strings "unicode", "us-ascii", and "utf-8" case-insensitively, and the default encoding is still lowercase. Let me know what you think.

>>> tree = ElementTree(Element('hello', {'beer': 'good'}))
>>> tree.write(stdout.buffer, encoding="UTF-8", xml_declaration=True); print()
<?xml version='1.0' encoding='UTF-8'?>
<hello beer="good" />
>>> tree.write(stdout.buffer, encoding="UTF-8"); print()
<hello beer="good" />
>>> tree.write(stdout.buffer, xml_declaration=True); print()
<?xml version='1.0' encoding='us-ascii'?>
<hello beer="good" />
Date User Action Args
2015-09-18 02:39:41martin.pantersetrecipients: + martin.panter, zimeon
2015-09-18 02:39:41martin.pantersetmessageid: <>
2015-09-18 02:39:41martin.panterlinkissue25047 messages
2015-09-18 02:39:41martin.pantercreate