diff --git a/kittens/diff/collect.py b/kittens/diff/collect.py index ac35b95de..9b9fc5986 100644 --- a/kittens/diff/collect.py +++ b/kittens/diff/collect.py @@ -142,7 +142,7 @@ def is_image(path): @lru_cache(maxsize=1024) def data_for_path(path): ans = raw_data_for_path(path) - if not is_image(path): + if not is_image(path) and not os.path.samefile(path, os.devnull): try: ans = ans.decode('utf-8') except UnicodeDecodeError: diff --git a/kittens/tui/images.py b/kittens/tui/images.py index aaa25007d..0a69ec590 100644 --- a/kittens/tui/images.py +++ b/kittens/tui/images.py @@ -230,11 +230,7 @@ class ImageManager: self.handler.cmd.gr_command(cmd) def convert_image(self, path, available_width, available_height, image_data, scale_up=False): - try: - rgba_path, width, height = convert(path, image_data, available_width, available_height, scale_up, tdir=self.tdir) - except ValueError: - rgba_path = None - width = height = 0 + rgba_path, width, height = convert(path, image_data, available_width, available_height, scale_up, tdir=self.tdir) return rgba_path, width, height def transmit_image(self, image_data, image_id, rgba_path, width, height):