[issue30011] HTMLParser class is not thread safe
Serhiy Storchaka added the comment: There is nothing wrong with building entitydefs multiple times since the result is same. An alternative is using locking, but this is more cumbersome solution. And building entitydefs is much faster than importing the threading module. $ ./python -m timeit -