Attempt to fix Unicode errors part two

This commit is contained in:
Simon 2018-06-16 15:30:44 -04:00
parent c309aa25c8
commit 86144935e3

View File

@ -113,7 +113,7 @@ class HttpDirectory(RemoteDirectory):
for link in links:
result.append((link.text, link.get("href")))
except UnicodeDecodeError:
tree = etree.HTML(body.decode("utf-8", errors="ignore"), parser=self.parser)
tree = etree.HTML(body.decode("utf-8", errors="ignore").encode("utf-8"), parser=self.parser)
links = []
try:
links = tree.findall(".//a/[@href]")