From 4771b94df303a3bb9c3ada5f4d2efe202b40d8a7 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Sun, 30 Mar 2025 04:26:33 +0000 Subject: ignore palette files with wrong encoding (#3620) --- lib/threads/palette.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') 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": -- cgit v1.2.3