New submission from Mark Summerfield <[EMAIL PROTECTED]>: Here is how to reproduce the bug:
from xml.etree.ElementTree import parse import io xml1 = """<?xml version="1.0" encoding="utf8"?> <test>text</test>""" xml2 = """<?xml version="1.0" encoding="utf-8"?> <test>text</test>""" f1 = io.StringIO(xml1) f2 = io.StringIO(xml2) tree2 = parse(f2) # this uses "utf-8" and works fine tree1 = parse(f1) Traceback (most recent call last): File "<pyshell#20>", line 1, in <module> tree1 = parse(f1) File "/home/mark/opt/python30a3/lib/python3.0/xml/etree/ElementTree.py", line 823, in parse tree.parse(source, parser) File "/home/mark/opt/python30a3/lib/python3.0/xml/etree/ElementTree.py", line 561, in parse parser.feed(data) File "/home/mark/opt/python30a3/lib/python3.0/xml/etree/ElementTree.py", line 1201, in feed self._parser.Parse(data, 0) xml.parsers.expat.ExpatError: unknown encoding: line 1, column 30 ---------- messages: 63471 nosy: mark severity: normal status: open title: [Py30a3] xml.parsers.expat recognizes encoding="utf-8" but not encoding="utf8" versions: Python 3.0 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2278> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com