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.

作者 Neil Muller
收信人 Neil Muller, effbot, jerith
日期 2009-06-11.10:53:51
SpamBayes Score 0.0018380245
Marked as misclassified
Message-id <1244717632.74.0.358309884859.issue6266@psf.upfronthosting.co.za>
In-reply-to
内容
Consider:

>>> from StringIO import StringIO
>>> source = StringIO('<body xmlns="http://&#233;ffbot.org/ns">text</body>')
>>> import xml.etree.ElementTree as ET
>>> events = ("start-ns",)
>>> context = ET.iterparse(source, events)
>>> for action, elem in context:
...    print action, elem
... 
start-ns ('', u'http://\xe9ffbot.org/ns')
>>> source.seek(0)
>>> import xml.etree.cElementTree as cET
>>> context = cET.iterparse(source, events)
>>> for action, elem in context:
...    print action, elem
... 
start-ns ('', 'http://\xc3\xa9ffbot.org/ns')

I'm not sure which is more correct here, but unsing different encodings
in the result is somewhat unexpected.
历史
日期 用户 动作 参数
2009-06-11 10:53:52Neil Muller修改recipients: + Neil Muller, effbot, jerith
2009-06-11 10:53:52Neil Muller修改messageid: <1244717632.74.0.358309884859.issue6266@psf.upfronthosting.co.za>
2009-06-11 10:53:51Neil Muller链接issue6266 messages
2009-06-11 10:53:51Neil Muller创建