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 mark
Recipients mark
Date 2008-03-12.11:03:54
SpamBayes Score 0.2820568
Marked as misclassified No
Message-id <1205319843.23.0.2378782834.issue2278@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2008-03-12 11:04:03marksetspambayes_score: 0.282057 -> 0.2820568
recipients: + mark
2008-03-12 11:04:03marksetspambayes_score: 0.282057 -> 0.282057
messageid: <1205319843.23.0.2378782834.issue2278@psf.upfronthosting.co.za>
2008-03-12 11:03:55marklinkissue2278 messages
2008-03-12 11:03:54markcreate