[issue17802] html.HTMLParser raises UnboundLocalError:

Thomas Barlow report at bugs.python.org
Mon Apr 22 21:26:41 CEST 2013


Thomas Barlow added the comment:

Just adding a patch here with a few unit tests to demonstrate the issue, comments here are welcome.  This is my first patch, I believe I have put the tests in the correct place.

It appears the problem only occurs if there is an incomplete XML entity where a sequence of valid characters (for an XML entity's name) lead to the end-of-file.

The test case for "a&b " passes, as it detects the space as an illegal character for the entity name.

----------
keywords: +patch
nosy: +Thomas.Barlow
Added file: http://bugs.python.org/file29979/issue17802-unittest.patch

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


More information about the Python-bugs-list mailing list