Skip to content

Commit

Permalink
fix(tasks.extract_from_html): Catch UnicodeDecodeError
Browse files Browse the repository at this point in the history
UnicodeDecodeError was bubbling because except clause was not catching it

Solves #181
  • Loading branch information
grossir committed Feb 27, 2024
1 parent b3cc4d7 commit b94524e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doctor/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def extract_from_html(path):
content = get_clean_body_content(content)
content = force_text(content, encoding=encoding)
return content, "", 0
except DoctorUnicodeDecodeError:
except (UnicodeDecodeError, DoctorUnicodeDecodeError):
pass
# Fell through, therefore unable to decode the string.
return "", "Could not encode content properly", 1
Expand Down

0 comments on commit b94524e

Please sign in to comment.