Improve documentation, cleanup duplicated code

This commit is contained in:
2021-03-28 15:03:42 +02:00
parent 07b018d2ab
commit cd053bc74e
5 changed files with 96 additions and 39 deletions

View File

@@ -231,7 +231,7 @@ class HTMLDownloadHandler(DownloadHandler):
"""
try:
fp = open(tmp_path, "r", encoding="yeetus")
fp = open(tmp_path, "r", encoding=charset)
html = fp.read()
except UnicodeDecodeError or LookupError:
fp = open(tmp_path, "r", encoding=FORMAT, errors="replace")