From 1425afe2447cd9090c361144ea754d457c360f79 Mon Sep 17 00:00:00 2001 From: Renato Date: Thu, 2 Jul 2026 18:18:40 +0200 Subject: [PATCH] fix: remove PYTHONPATH from subprocess env to prevent protobuf/mediapipe conflict --- openshorts/telegram_bot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openshorts/telegram_bot.py b/openshorts/telegram_bot.py index af47911..bf70778 100644 --- a/openshorts/telegram_bot.py +++ b/openshorts/telegram_bot.py @@ -237,7 +237,11 @@ async def process_video(bot, url: str): env = os.environ.copy() env["NEXTCLOUD_TARGET"] = target env["PYTHONUNBUFFERED"] = "1" + # CRITICAL: Remove PYTHONPATH so the system protobuf doesn't conflict with + # the venv's protobuf used by mediapipe → fixes 'SymbolDatabase.GetPrototype' crash + env.pop("PYTHONPATH", None) log.info(f"[process] Temp output dir: {temp_output}") + log.info(f"[process] PYTHONPATH cleared from subprocess env (mediapipe safety)") # 4. Build command — main.py MUST run with the viral venv Python cmd = [