[issue10759] HTMLParser.unescape() fails on HTML entities with incorrect syntax (e.g. &#hearts; )

Martin Potthast report at bugs.python.org
Wed Dec 22 20:23:19 CET 2010


Martin Potthast <martin.potthast at googlemail.com> added the comment:

Why not simply remove the additional check in line 168 and leave the responsibility to check the validity of its input to the unescape function (be it explicitly or, like now, lazily). That way, the code changes are minimal, the existing test covers the current issue, and the function gets more robust.

By the way, I came across this function via Stackoverflow:
http://stackoverflow.com/questions/2087370

----------

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


More information about the Python-bugs-list mailing list