Comment 1 for bug 2007343

Revision history for this message
Leonard Richardson (leonardr) wrote : Re: No overriding parent class method in version 4.11.2

Thanks for filing this issue. This was my mistake: I was removing code that was only needed in versions of Python that Beautiful Soup doesn't support. HTMLParser.error() was removed in Python 3.5, but its superclass *also* implements the same method, and that method wasn't removed until Python 3.10 (see https://github.com/python/cpython/issues/76025).

However, it probably doesn't make a difference, because in every case I've seen, suppressing these errors just means that the bad markup crashes Python's html.parser immediately after the error() call returns, due to either https://github.com/python/cpython/issues/81928 or https://github.com/python/cpython/issues/78661. Every fuzzer issue I've seen so far turned out to be one of those two CPython issues.

I'll replace the error() implementation in the next version, and I'll probably have it raise ParserRejectedMarkup instead of suppressing the error, so that the cause of the problem is more clear.