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.

classification
Title: Unhandled Exception (Not Implemented) in HTMLParser().feed
Type: security Stage: resolved
Components: Parser Versions: Python 3.9
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Not Implemented Error in stdLib HTMLParser
View: 38573
Assigned To: Nosy List: lys.nikolaou, md103, xtreak
Priority: normal Keywords:

Created on 2021-08-15 10:36 by md103, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg399611 - (view) Author: Mark Deen (md103) Date: 2021-08-15 10:36
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()
msg399619 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2021-08-15 14:31
Seems similar to https://bugs.python.org/issue38573
History
Date User Action Args
2022-04-11 14:59:48adminsetgithub: 89081
2021-08-20 21:46:41terry.reedysetstatus: open -> closed
superseder: Not Implemented Error in stdLib HTMLParser
resolution: duplicate
stage: resolved
2021-08-15 14:31:40xtreaksetnosy: + xtreak
messages: + msg399619
2021-08-15 14:18:32pablogsalsetnosy: - pablogsal
2021-08-15 10:36:20md103create