From 624a35fa74d266e4e2b4f81be6110eca20a76e9e Mon Sep 17 00:00:00 2001 From: Sara Johnsson <46252070+Fendse@users.noreply.github.com> Date: Sat, 30 Jan 2021 16:07:52 +0100 Subject: Prevent crash on non-UTF-8 hint dictionary (cherry picked from commit 90b598282b9777164cfaf44bd717c499d1067194) --- qutebrowser/browser/hints.py | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3-54-g00ecf