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.

classification
Title: xml.parsers.expat results differ buffer_text and / or buffer_size
Type: behavior Stage: resolved
Components: XML Versions: Python 3.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: doerwalter, mfxuus
Priority: normal Keywords:

Created on 2021-01-14 22:04 by mfxuus, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg385086 - (view) Author: Michael XU (mfxuus) Date: 2021-01-14 22:04
More details available here:
https://stackoverflow.com/questions/65676934/python-xml-parsers-expat-results-differ-based-on-buffer-text-true-or-false-and

Raw data to replicate the issue is available upon request.
msg385104 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2021-01-15 10:05
Just a guess, but the buffer size might be so small that the text that you expect gets passed via **two** calls to _char_data(). You should refactor your code the simply collect all the text in _char_data() and act on it in the _end_element() handler.

So this probably isn't a bug in xml.parsers.expat.
msg385112 - (view) Author: Michael XU (mfxuus) Date: 2021-01-15 14:29
Thank you so much Walter. I think that might be it - it fixed this particular instance, and it makes sense given what you have said. I'll proceed to close this up but will follow up if I encounter this issue when the data has changed.

Thanks again!
History
Date User Action Args
2022-04-11 14:59:40adminsetgithub: 87096
2021-01-15 14:29:28mfxuussetstatus: open -> closed
resolution: not a bug
messages: + msg385112

stage: resolved
2021-01-15 10:05:03doerwaltersetnosy: + doerwalter
messages: + msg385104
2021-01-14 22:04:58mfxuuscreate