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 Frederick.Ross
Recipients Frederick.Ross
Date 2012-05-18.17:29:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1337362162.37.0.214988903095.issue14852@psf.upfronthosting.co.za>
In-reply-to
Content
When parsing something like '<a>x</a><a>y</a>' with xml.etree.ElementTree, or '{}{}' with json, these parser throw exceptions instead of reading a single element of the kind they understand off the stream (or throwing an exception if there is no element they understand) and leaving the stream in a sane state.

So I should be able to write

import xml.etree.ElementTree as et
import StringIO
s = StringIO.StringIO("<a>x</a><a>y</a>")
elem1 = et.parse(s)
elem2 = et.parse(s)

and have elem1 correspond to "<a>x</a>" and elem2 correspond to "<a>y</a>".

At the very least, if the parsers refuse to parse partial streams, they should at least not destroy the streams.
History
Date User Action Args
2012-05-18 17:29:22Frederick.Rosssetrecipients: + Frederick.Ross
2012-05-18 17:29:22Frederick.Rosssetmessageid: <1337362162.37.0.214988903095.issue14852@psf.upfronthosting.co.za>
2012-05-18 17:29:21Frederick.Rosslinkissue14852 messages
2012-05-18 17:29:21Frederick.Rosscreate