Skip to content

Commit

Permalink
Merge pull request #159 from wiseaidev/fix-uni-dec-enc
Browse files Browse the repository at this point in the history
handle UnicodeDecode exception
  • Loading branch information
marshalmiller authored Oct 2, 2022
2 parents 1616f0f + 7db232d commit 1926d5c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion linkrot/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ def make_compat_str(in_str):
enc = chardet.detect(in_str)

# Decode the object into a unicode object
out_str = in_str.decode(enc["encoding"])
try:
out_str = in_str.decode(enc["encoding"])
except UnicodeDecodeError as err:
out_str = ""

# Cleanup
if enc["encoding"] == "UTF-16BE":
Expand Down

0 comments on commit 1926d5c

Please sign in to comment.