[New-bugs-announce] [issue44918] Unhandled Exception (Not Implemented) in HTMLParser().feed

Mark Deen report at bugs.python.org
Sun Aug 15 06:36:20 EDT 2021


New submission from Mark Deen <md at markdeen.io>:

The hexadecimal sequence '3c215b02634717' when passed as an argument to HTMLParser()'s feed function results in the exception noted below. The code example below illustrates this exception.

from html.parser import HTMLParser

parser = HTMLParser()
parser.feed(bytearray.fromhex('3c215b02634717').decode('ascii'))


Traceback (most recent call last):
  File "poc.py", line 5, in <module>
    parser.feed(bytearray.fromhex('3c215b02634717').decode('ascii'))
  File "/usr/lib/python3.9/html/parser.py", line 110, in feed
    self.goahead(0)
  File "/usr/lib/python3.9/html/parser.py", line 178, in goahead
    k = self.parse_html_declaration(i)
  File "/usr/lib/python3.9/html/parser.py", line 263, in parse_html_declaration
    return self.parse_marked_section(i)
  File "/usr/lib/python3.9/_markupbase.py", line 149, in parse_marked_section
    sectName, j = self._scan_name( i+3, i )
  File "/usr/lib/python3.9/_markupbase.py", line 390, in _scan_name
    self.error("expected name token at %r"
  File "/usr/lib/python3.9/_markupbase.py", line 33, in error
    raise NotImplementedError(
NotImplementedError: subclasses of ParserBase must override error()

----------
components: Parser
messages: 399611
nosy: lys.nikolaou, md103, pablogsal
priority: normal
severity: normal
status: open
title: Unhandled Exception (Not Implemented) in HTMLParser().feed
type: security
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44918>
_______________________________________


More information about the New-bugs-announce mailing list