From 1203ab6c94193733f388d4f1afa67524d09967c4 Mon Sep 17 00:00:00 2001 From: Ckuma Date: Wed, 17 Jun 2026 13:39:44 -0400 Subject: [PATCH] Bundle PIL._tkinter_finder in PyInstaller builds PIL.ImageTk imports PIL._tkinter_finder at runtime to register Pillow's image objects with the Tcl/Tk interpreter (the PyImagingPhoto command). PyInstaller does not reliably collect this submodule across versions, so the frozen Linux build shipped in v4.1 crashed on startup when ttkbootstrap drew the combobox arrow asset: ModuleNotFoundError: No module named 'PIL._tkinter_finder' Add it as an explicit --hidden-import on all three build paths (CI Linux, CI Windows, and build_exe.bat) so it is always bundled regardless of the PyInstaller version installed at build time. Fixes #5 --- .github/workflows/build.yml | 2 ++ python/build_exe.bat | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cbefbfe..2097f46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,6 +64,7 @@ jobs: run: | pyinstaller --onefile --windowed --name "SCPlaytime" ` --add-data "resources;resources" ` + --hidden-import "PIL._tkinter_finder" ` sc_main.py - name: Upload Python Windows artifact @@ -103,6 +104,7 @@ jobs: run: | pyinstaller --onefile --windowed --name "SCPlaytime" \ --add-data "resources:resources" \ + --hidden-import "PIL._tkinter_finder" \ sc_main.py - name: Upload Python Linux artifact diff --git a/python/build_exe.bat b/python/build_exe.bat index 573ea20..665a131 100644 --- a/python/build_exe.bat +++ b/python/build_exe.bat @@ -72,6 +72,7 @@ pyinstaller ^ --windowed ^ --name "SCPlaytime" ^ --add-data "resources;resources" ^ + --hidden-import "PIL._tkinter_finder" ^ --clean ^ --noconfirm ^ sc_main.py