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

Frederick Ross report at bugs.python.org
Fri May 25 22:06:38 CEST 2012


Frederick Ross <madhadron at gmail.com> 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 in a streaming network connection. If the parser leaves it in an unusable state, then I lose everything that may follow. It makes Python unusable in certain, not very rare, cases of network programming.

I'll just add that Haskell's Parsec does this right, and should be used as an example.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14852>
_______________________________________


More information about the Python-bugs-list mailing list