summaryrefslogtreecommitdiff
path: root/qutebrowser/completion
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-07-13 16:23:40 +0200
committerFlorian Bruhin <me@the-compiler.org>2021-07-13 16:23:40 +0200
commit676c9db2fe9833e52b12f723c3ed62a38759f82d (patch)
tree32539cba571a1efddf5308ff838bb8081dc650ff /qutebrowser/completion
parenteffc5b56382a0c3962a583404d556ba9ddffdb69 (diff)
downloadqutebrowser-676c9db2fe9833e52b12f723c3ed62a38759f82d.tar.gz
qutebrowser-676c9db2fe9833e52b12f723c3ed62a38759f82d.zip
Handle and test more file path corner cases
Diffstat (limited to 'qutebrowser/completion')
-rw-r--r--qutebrowser/completion/models/filepathcategory.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/qutebrowser/completion/models/filepathcategory.py b/qutebrowser/completion/models/filepathcategory.py
index f9b6608a3..db2733b4f 100644
--- a/qutebrowser/completion/models/filepathcategory.py
+++ b/qutebrowser/completion/models/filepathcategory.py
@@ -93,9 +93,9 @@ class FilePathCategory(QAbstractListModel):
else:
try:
expanded = os.path.expanduser(val)
- except UnicodeEncodeError:
+ except (UnicodeEncodeError, ValueError):
# os.path.expanduser('~\ud800') can raise UnicodeEncodeError
- # via pwd.getpwnam
+ # via pwd.getpwnam. '~\x00' can raise ValueError.
expanded = val
paths = self._glob(expanded)
self._paths = sorted(self._contract_user(val, path) for path in paths)