diff options
author | Sara Johnsson <46252070+Fendse@users.noreply.github.com> | 2021-01-30 16:07:52 +0100 |
---|---|---|
committer | Sara Johnsson <46252070+Fendse@users.noreply.github.com> | 2021-01-30 16:18:28 +0100 |
commit | 90b598282b9777164cfaf44bd717c499d1067194 (patch) | |
tree | 121872144758952b73e2c668fb1e0185e8d30a9f | |
parent | 9a5fe232cd2c59128141261435c4b3ff7fd9be43 (diff) | |
download | qutebrowser-90b598282b9777164cfaf44bd717c499d1067194.tar.gz qutebrowser-90b598282b9777164cfaf44bd717c499d1067194.zip |
Prevent crash on non-UTF-8 hint dictionary
-rw-r--r-- | qutebrowser/browser/hints.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index 6cc4fb035..84474b6b0 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -1074,6 +1074,9 @@ class WordHinter: except OSError as e: error = "Word hints requires reading the file at {}: {}" raise HintingError(error.format(dictionary, str(e))) + except UnicodeDecodeError as e: + error = "Word hints expects the file at {} to be encoded as UTF-8: {}" + raise HintingError(error.format(dictionary, str(e))) def extract_tag_words( self, elem: webelem.AbstractWebElement |