[issue14852] json and ElementTree parsers misbehave on streams containing more than a single object

2012-05-25 Thread Frederick Ross
Frederick Ross added the comment: In the case of files, sure, it's fine. The error gives me the offset, and I can go pull it out and buffer it, and it's fine. Plus XML is strict about having only one document per file. For streams, none of this is applicable. I can't seek

[issue14852] json and ElementTree parsers misbehave on streams containing more than a single object

2012-05-25 Thread Frederick Ross
Frederick Ross added the comment: Antoine, It's not iterative parsing, it's a sequence of XML docs or json objects. Eric, the server I'm retrieving from, for real time searches, steadily produces a stream of (each properly formed) XML or json documents containing new search r

[issue14891] An error in bindings of closures

2012-05-23 Thread Frederick Ross
Frederick Ross added the comment: Assignment in Python creates a new binding. Whether the new binding shadows or replaces an old binding should be irrelevant. This behavior is inconsistent with that. Please fix expectations, and then Python interpreter. -- resolution: invalid

[issue14891] An error in bindings of closures

2012-05-23 Thread Frederick Ross
New submission from Frederick Ross : The following code throws an UnboundLocal error: def f(x): def g(): x = x + "a" return x return g() f("b") -- components: None messages: 161432 nosy: Frederick.Ross priority: normal severity: normal st

[issue14852] json and ElementTree parsers misbehave on streams containing more than a single object

2012-05-18 Thread Frederick Ross
New submission from Frederick Ross : When parsing something like 'xy' 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 ele