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 ezio.melotti
Recipients docs@python, ezio.melotti, martin.panter, r.david.murray, serhiy.storchaka, xkjq
Date 2015-03-07.16:41:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1425746494.16.0.47780449049.issue23144@psf.upfronthosting.co.za>
In-reply-to
Content
Here is a patch that fixes the problem.
Even though calling .close() is the correct solution, I preferred to restore the previous behavior and call handle_data as soon as possible.
There is a corner case in which a charref might be cut in half while feeding chunks to the parser -- in that case the parser will wait and it might still be necessary to call .close() if an incomplete charref is at the end of the string.
Adding context manager support to HTMLParser might also help solving the problem, but that's a separate issue.
(Also thanks to Serhiy for the feedback he provided me on IRC.)
History
Date User Action Args
2015-03-07 16:41:34ezio.melottisetrecipients: + ezio.melotti, r.david.murray, docs@python, martin.panter, serhiy.storchaka, xkjq
2015-03-07 16:41:34ezio.melottisetmessageid: <1425746494.16.0.47780449049.issue23144@psf.upfronthosting.co.za>
2015-03-07 16:41:34ezio.melottilinkissue23144 messages
2015-03-07 16:41:33ezio.melotticreate