It is raised here: https://github.com/lxml/lxml/blob/master/src/lxml/html/__init__.py#L1432 and https://github.com/lxml/lxml/blob/master/src/lxml/html/__init__.py#L1436
However I'm not sure if this is the reason why it is raised in this specify case.