Commit 301f2a2c authored by Administrator's avatar Administrator

[BUG FIX] parsing execption for irregular files.

parent 62e6d443
......@@ -26,7 +26,11 @@ class EuropressFileParser(FileParser):
encoding = self.detect_encoding(contents)
#print(encoding)
#if encoding != "utf-8":
contents = contents.decode(encoding, errors='replace').encode(codif)
try:
contents = contents.decode(encoding, errors='replace').encode(codif)
except Exception as error:
print(error)
pass
try:
html_parser = etree.HTMLParser(encoding=codif)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment