diff --git a/kittens/diff/collect.py b/kittens/diff/collect.py index 47d16af57..0f479c35a 100644 --- a/kittens/diff/collect.py +++ b/kittens/diff/collect.py @@ -155,7 +155,7 @@ def sanitize(text: str) -> str: @lru_cache(maxsize=1024) def mime_type_for_path(path: str) -> str: - return guess_type(path) or 'application/octet-stream' + return guess_type(path, allow_filesystem_access=True) or 'application/octet-stream' @lru_cache(maxsize=1024) diff --git a/kitty/complete.py b/kitty/complete.py index 48fdec998..5b4863f6a 100644 --- a/kitty/complete.py +++ b/kitty/complete.py @@ -478,7 +478,7 @@ def complete_icat_args(ans: Completions, opt: Optional[OptionDict], prefix: str, from .guess_mime_type import guess_type def icat_file_predicate(filename: str) -> bool: - mt = guess_type(filename) + mt = guess_type(filename, allow_filesystem_access=True) if mt and mt.startswith('image/'): return True return False