You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
html.parser: check_for_whole_start_tag crashes with AssertionError on empty string #140877
Traceback (mostrecentcalllast):
File"/data/src/test.py", line11, in<module>result=parser.check_for_whole_start_tag(0)
File"/home/hdd/miniconda3/lib/python3.13/html/parser.py", line394, incheck_for_whole_start_tagraiseAssertionError("we should not get here!")
AssertionError: weshouldnotgethere!
I think the internal code should gracefully handle this None match by returning -1 instead if an AssertionError?
This works as expected. check_for_whole_start_tag() should only be called if the next characters are < followed by an ASCII letter. Assertions just check an internal consistency of the code.
Activity
T90REAL commentedon Nov 1, 2025
Not only empty string, but also some incomplete tag such as '<ª' would trigger this assertion.
efimov-mikhail commentedon Nov 1, 2025
cc @serhiy-storchaka because of 135930
serhiy-storchaka commentedon Nov 1, 2025
This works as expected.
check_for_whole_start_tag()should only be called if the next characters are<followed by an ASCII letter. Assertions just check an internal consistency of the code.