Age | Commit message (Collapse) | Author |
|
(cherry picked from commit 52d551875dba74b63b322a07baa4aeac4da865eb)
|
|
(cherry picked from commit 676c9db2fe9833e52b12f723c3ed62a38759f82d)
|
|
(cherry picked from commit 0001d4fe20a4cdef9dd628fad220e09a03618932)
|
|
|
|
On GitHub Actions, it looks like there's a situation where
os.path.expanduser and pathlib.Path.expanduser disagree.
When in test_filesystem_completion_hypothesis the completion gets '~' as
input, it fails with:
tests/unit/completion/test_models.py:469: in test_filesystem_completion_hypothesis
model.set_pattern(text)
qutebrowser/completion/models/filepathcategory.py:88: in set_pattern
self._paths = sorted(self._contract_user(val, path) for path in paths)
qutebrowser/completion/models/filepathcategory.py:88: in <genexpr>
self._paths = sorted(self._contract_user(val, path) for path in paths)
qutebrowser/completion/models/filepathcategory.py:52: in _contract_user
return str(head / pathlib.Path(path).relative_to(head.expanduser()))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = PosixPath('/home/runneradmin'), other = (PosixPath('/home/runner'),)
parts = ['/', 'home', 'runneradmin'], drv = '', root = '/'
def relative_to(self, *other):
[...]
E ValueError: '/home/runneradmin' does not start with '/home/runner'
Let's use os.path everywhere, so we can be sure the two code paths agree
with each other.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Florian Bruhin <me@the-compiler.org>
|
|
Co-authored-by: Florian Bruhin <me@the-compiler.org>
|
|
Co-authored-by: Florian Bruhin <me@the-compiler.org>
|
|
Co-authored-by: Florian Bruhin <me@the-compiler.org>
|
|
|
|
|
|
|
|
|