remove unused vars
remove unused import
except: -> except Exception:
remove unused imports
Fall back to text/html if no mimetype. Not sure this is 100% sane, but since I don't have .html endings on my files, I need something like this