Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(8)

Unified Diff: Lib/xml/etree/ElementTree.py

Issue 25047: xml.etree.ElementTree encoding declaration should be capital ('UTF-8') rather than lowercase ('utf-8')
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_xml_etree.py ('k') | Misc/NEWS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/xml/etree/ElementTree.py Tue Sep 15 19:59:03 2015 +0300
+++ b/Lib/xml/etree/ElementTree.py Fri Sep 18 02:37:40 2015 +0000
@@ -756,14 +756,13 @@
encoding = "utf-8"
else:
encoding = "us-ascii"
- else:
- encoding = encoding.lower()
- with _get_writer(file_or_filename, encoding) as write:
+ enc_lower = encoding.lower()
+ with _get_writer(file_or_filename, enc_lower) as write:
if method == "xml" and (xml_declaration or
(xml_declaration is None and
- encoding not in ("utf-8", "us-ascii", "unicode"))):
+ enc_lower not in ("utf-8", "us-ascii", "unicode"))):
declared_encoding = encoding
- if encoding == "unicode":
+ if enc_lower == "unicode":
# Retrieve the default encoding for the xml declaration
import locale
declared_encoding = locale.getpreferredencoding()
« no previous file with comments | « Lib/test/test_xml_etree.py ('k') | Misc/NEWS » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+