summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2022-07-05 16:07:50 +0200
committerFlorian Bruhin <me@the-compiler.org>2022-07-05 16:07:50 +0200
commit991cf1e8baee1a2365c1e2e81f92ce348344871c (patch)
tree8724a977d438672a22a7a76c8a33283a58405956
parenta16aa959bbc81ddb8ed8f2b945be2cf10251fee8 (diff)
downloadqutebrowser-991cf1e8baee1a2365c1e2e81f92ce348344871c.tar.gz
qutebrowser-991cf1e8baee1a2365c1e2e81f92ce348344871c.zip
Handle OSError from adblock
When the file is e.g. unreadable, .is_file() will work, but this step will fail.
-rw-r--r--doc/changelog.asciidoc1
-rw-r--r--qutebrowser/components/braveadblock.py2
2 files changed, 3 insertions, 0 deletions
diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc
index d1b0f4e65..d645775a1 100644
--- a/doc/changelog.asciidoc
+++ b/doc/changelog.asciidoc
@@ -97,6 +97,7 @@ Fixed
shown, qutebrowser used to only show one message. This is now only done when the
two messages are completely equivalent (text, level, etc.) instead of doing so
when only the text matches.
+- Crash when the adblock filter file can't be read.
[[v2.5.2]]
v2.5.2 (2022-06-22)
diff --git a/qutebrowser/components/braveadblock.py b/qutebrowser/components/braveadblock.py
index 977aa3ef2..94dfb547c 100644
--- a/qutebrowser/components/braveadblock.py
+++ b/qutebrowser/components/braveadblock.py
@@ -267,6 +267,8 @@ class BraveAdBlocker:
except DeserializationError:
message.error("Reading adblock filter data failed (corrupted data?). "
"Please run :adblock-update.")
+ except OSError as e:
+ message.error(f"Reading adblock filter data failed: {e}")
elif (
config.val.content.blocking.adblock.lists
and not self._has_basedir