[issue10149] Data truncation in expat parser

Maciek J report at bugs.python.org
Wed Oct 20 20:05:29 CEST 2010


Maciek J <egil at wp.pl> added the comment:

Hm... It turns out that there is a "buffer_text" attribute:
http://docs.python.org/library/pyexpat.html#xml.parsers.expat.xmlparser.buffer_text
And setting this attribute to "True" seems to solve the problem.

It solves my problem, but docs are still very confusing. I see two things that should be fixed:
1. In CharacterDataHandler description it should be explicitly noted that data may be chunked even if it is short(!).
2. Description of buffer_text attribute should contain a notice that data may also be arbitrary chunked if this is set to False. My data _was_not_ chunked at new line characters (as the description suggest). It was chunked in the middle of a sentence (there were no whitespace in it!).

----------

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


More information about the Python-bugs-list mailing list