From 4289e65e6fef494a9ba3e2a5951cad0add087d05 Mon Sep 17 00:00:00 2001 From: brockdarnold Date: Sun, 14 Jun 2026 07:30:03 +0000 Subject: [PATCH] publish update.py --- update.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/update.py b/update.py index 3fe00af..3171147 100644 --- a/update.py +++ b/update.py @@ -51,6 +51,13 @@ def ensure_config(): print("• created config.ini from example (webhook prefilled).") else: print("• config.ini exists — your settings + OCR snip left untouched.") + # heal a UTF-8 BOM left by the old PowerShell installer (breaks configparser) + with open(cfg, "rb") as fh: + raw = fh.read() + if raw.startswith(b"\xef\xbb\xbf"): + with open(cfg, "wb") as fh: + fh.write(raw[3:]) + print("• stripped a UTF-8 BOM from config.ini (old-installer leftover).") return cfg, first @@ -101,7 +108,7 @@ def start_watchers(cfg_path): run(["powershell", "-ExecutionPolicy", "Bypass", "-File", os.path.join(HERE, "start-all.ps1")]) cp = configparser.ConfigParser() - cp.read(cfg_path) + cp.read(cfg_path, encoding="utf-8-sig") if cp.get("watcher", "mode", fallback="ocr") == "ocr" and \ not cp.get("ocr", "region", fallback="").strip(): print("\n >> ONE-TIME (per PC) for hold/compress/stall alerts, run once:\n"