This is not a development question, but the answer is that the file
Code:
/usr/local/lib/python3.7/site-packages/bs4/builder/_htmlparser.py
is totally broken. And it doesn't belong to calibre, and it doesn't belong to the Fedora package repositories because it is in /usr/local
Have you been sudo pip installing things? Maybe don't do that.