You could add a gc.collect() after each step of the test to see which one triggers the problem. That way, it should at least be possible to extract the HTML(?) page being processed and the problematic code section. Otherwise, given the massive amount of dependencies in the crashing system, it's nearly impossible to make even a guess what's going on here.
(Well, at least something seems to be keeping HTML trees in a reference cycle somewhere which are then cleaned up in cyclic garbage collection. But that's still very generic...)
You could add a gc.collect() after each step of the test to see which one triggers the problem. That way, it should at least be possible to extract the HTML(?) page being processed and the problematic code section. Otherwise, given the massive amount of dependencies in the crashing system, it's nearly impossible to make even a guess what's going on here.
(Well, at least something seems to be keeping HTML trees in a reference cycle somewhere which are then cleaned up in cyclic garbage collection. But that's still very generic...)