diff options
author | Sara Johnsson <46252070+Fendse@users.noreply.github.com> | 2021-01-30 16:07:52 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-02-03 18:38:33 +0100 |
commit | 624a35fa74d266e4e2b4f81be6110eca20a76e9e (patch) | |
tree | d958021446f592be1981e1b02167826c03352202 | |
parent | a6ac2793a39fd83e174e5b957f01e4e2888474c7 (diff) | |
download | qutebrowser-624a35fa74d266e4e2b4f81be6110eca20a76e9e.tar.gz qutebrowser-624a35fa74d266e4e2b4f81be6110eca20a76e9e.zip |
Prevent crash on non-UTF-8 hint dictionary
(cherry picked from commit 90b598282b9777164cfaf44bd717c499d1067194)
-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 |