From 1789eae0b5bcc4275d50547ec7e20000e599c87c Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Wed, 22 Apr 2026 15:10:07 -0400 Subject: [PATCH] Fix bundled app failing to find Chromium browser Set PLAYWRIGHT_BROWSERS_PATH to ~/Library/Caches/ms-playwright/ so the PyInstaller .app uses the system-wide browser cache instead of looking inside its own bundle. --- stampli_core.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stampli_core.py b/stampli_core.py index df738f1..76d39a0 100644 --- a/stampli_core.py +++ b/stampli_core.py @@ -1,9 +1,17 @@ """Shared logic for Stampli bulk editor — used by both CLI scripts and the GUI.""" import json +import os import time from datetime import datetime, timedelta from pathlib import Path + +# Use system-wide Playwright browser cache so the bundled app doesn't +# look for browsers inside its own .app bundle. +_pw_cache = Path.home() / "Library" / "Caches" / "ms-playwright" +if _pw_cache.is_dir(): + os.environ.setdefault("PLAYWRIGHT_BROWSERS_PATH", str(_pw_cache)) + from playwright.sync_api import sync_playwright PROJECT_DIR = Path(__file__).parent