summaryrefslogtreecommitdiff
path: root/lib/threads
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-03-30 04:26:33 +0000
committerGitHub <noreply@github.com>2025-03-30 06:26:33 +0200
commit4771b94df303a3bb9c3ada5f4d2efe202b40d8a7 (patch)
tree25c390c76c294e35f36a9069fcedeb55a2418239 /lib/threads
parentdd63ef093562b8ece48ff215c038e42120a9817e (diff)
ignore palette files with wrong encoding (#3620)
Diffstat (limited to 'lib/threads')
-rw-r--r--lib/threads/palette.py7
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":