[issue10759] HTMLParser.unescape() fails on HTML entities with incorrect syntax (e.g. &#hearts; )
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:
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list