From 33aa6aba33b764618590ab9ebbb8da5b63deef98 Mon Sep 17 00:00:00 2001 From: Kingston-SCYD Date: Sat, 6 Jun 2026 19:48:27 -0500 Subject: [PATCH] morshu-server: fix startup by passing env and using sys.executable --- ttstoy/ttstoy.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ttstoy/ttstoy.py b/ttstoy/ttstoy.py index 0212d11..b18be7d 100644 --- a/ttstoy/ttstoy.py +++ b/ttstoy/ttstoy.py @@ -1,4 +1,5 @@ import os +import sys import shutil import logging import asyncio @@ -527,10 +528,14 @@ class TtsToy(Cog): log.error(f"Morshu server not found: {server_py}") return False + env = os.environ.copy() + env['PORT'] = str(self.morshu_port) + self.morshu_process = await asyncio.to_thread( subprocess.Popen, - ["python3", "server.py"], + [sys.executable, "server.py"], cwd=str(self.morshu_dir), + env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True