diff kitten: Report errors converting images

This commit is contained in:
Kovid Goyal
2018-05-20 15:01:25 +05:30
parent 2a9dc23c61
commit fa3e173c18
2 changed files with 2 additions and 6 deletions

View File

@@ -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: