Bug report
Bug description:
The html.parser.HTMLParser method check_for_whole_start_tag crashes with an AssertionError when its rawdata is an empty string.
from html.parser import HTMLParser
parser = HTMLParser()
parser.feed('')
result = parser.check_for_whole_start_tag(0)
Traceback (most recent call last):
File "/data/src/test.py", line 11, in <module>
result = parser.check_for_whole_start_tag(0)
File "/home/hdd/miniconda3/lib/python3.13/html/parser.py", line 394, in check_for_whole_start_tag
raise AssertionError("we should not get here!")
AssertionError: we should not get here!
I think the internal code should gracefully handle this None match by returning -1 instead if an AssertionError?
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Bug report
Bug description:
The
html.parser.HTMLParsermethodcheck_for_whole_start_tagcrashes with anAssertionErrorwhen its rawdata is an empty string.I think the internal code should gracefully handle this None match by returning -1 instead if an
AssertionError?CPython versions tested on:
3.13
Operating systems tested on:
Linux