diff options
Diffstat (limited to 'lib/threads')
| -rw-r--r-- | lib/threads/palette.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/threads/palette.py b/lib/threads/palette.py index e303f09f..b78f43a1 100644 --- a/lib/threads/palette.py +++ b/lib/threads/palette.py @@ -39,7 +39,12 @@ class ThreadPalette(Set): """ with open(palette_file, encoding='utf8') as palette: - line = palette.readline().strip() + try: + line = palette.readline().strip() + except UnicodeDecodeError: + # File has wrong encoding. Can't read this file + self.is_gimp_palette = False + return self.is_gimp_palette = True if line.lower() != "gimp palette": |
