mirror of
https://github.com/harry0703/MoneyPrinterTurbo.git
synced 2026-11-14 18:22:59 +01:00
os.path.relpath raises ValueError on Windows when the record's file and PROJECT_ROOT resolve to different mounts. That happens whenever the project is launched through a mapped network drive or a subst drive: the call frame keeps X:\MoneyPrinterTurbo\..., while realpath resolves PROJECT_ROOT back to C:\... Loguru catches the formatter error and discards the record, so the terminal and the WebUI log panel both go silent. Fall back to the absolute path there, and also when the file sits outside the project root, where "./" glued onto a ".." climb is no easier to read than the original path. Render the relative path with forward slashes as well, so Windows logs show "./app/services/task.py" like every other platform instead of the mixed "./app\services\task.py". test_webui_task.py already asserted the POSIX form but is not part of the Windows smoke job, so the drift went unnoticed; add it to that job to keep the regression covered on the platform where it appears.