Files
DeepTutor/scripts
jonathanzhan1975 8e1ceba3aa fix: server startup on Windows + missing runtime deps
Two independent issues that block `python scripts/start_web.py` after a
clean install on Windows:

1. UnicodeDecodeError when streaming subprocess output

   `_spawn()` opened the backend / frontend stdout pipe with `text=True`
   but no explicit encoding. On Windows this defaults to the system
   ANSI codepage (e.g. `gbk` on Chinese Windows), which raises
   `UnicodeDecodeError` as soon as the child process emits a UTF-8 byte.

   Fix: pin `encoding="utf-8"` and `errors="replace"` so any locale
   produces clean, lossless output.

2. Missing runtime dependencies in requirements/server.txt

   `deeptutor/services/llm/provider_core/__init__.py` unconditionally
   imports `AnthropicProvider`, `OpenAICompatProvider`, and
   `OpenAIResponses`, which in turn import:

     - `loguru`        (provider_core/base.py, openai_codex_provider.py,
                        openai_responses/parsing.py)
     - `json_repair`   (anthropic_provider.py, openai_compat_provider.py,
                        openai_responses/parsing.py)

   These are declared only in `requirements/tutorbot.txt`, so
   `pip install -r requirements/server.txt && pip install -e .` followed
   by `python scripts/start_web.py` crashes with `ModuleNotFoundError`
   before the API server can serve a single request.

   Fix: declare both packages in `server.txt` with the same version
   bounds used by `tutorbot.txt`.

Reproduced and verified on Windows 11 + Python 3.12 + a fresh venv.
2026-04-26 09:16:06 +08:00
..
2026-04-24 23:15:26 +08:00
2026-03-15 00:04:34 +08:00
2026-04-23 19:29:16 +08:00
2026-04-24 23:15:26 +08:00
2026-04-23 19:29:16 +08:00
2026-04-23 19:29:16 +08:00