fix: pass PYTHONIOENCODING to the job subprocess too
The stdio reconfigure only covers the API process. main.py prints an emoji on its first line and configures nothing, so on a cp1252 console the server now starts but every job dies before rendering.
This commit is contained in:
parent
df0bc19df2
commit
6e439785c6
1 changed files with 5 additions and 0 deletions
5
app.py
5
app.py
|
|
@ -1693,6 +1693,11 @@ async def process_endpoint(
|
|||
cmd = [sys.executable, "-u", "main.py"] # -u for unbuffered
|
||||
env = os.environ.copy()
|
||||
env["GEMINI_API_KEY"] = api_key # Override with key from request
|
||||
# The stdio fix above only covers this process. main.py prints an emoji on
|
||||
# its first line and configures nothing, so on a cp1252 console the child
|
||||
# still dies before it renders anything -- the server starts and every job
|
||||
# fails instead. setdefault, so an explicit PYTHONIOENCODING still wins.
|
||||
env.setdefault("PYTHONIOENCODING", "utf-8")
|
||||
|
||||
# Optional layouts are per job. The renderer reads these at import time in
|
||||
# the subprocess, so they must be set before Popen — same path WATERMARK
|
||||
|
|
|
|||
Loading…
Reference in a new issue