Repository navigation
progress_dashboard: publish text through a unique temp file - #4492
Conversation
Kam471
left a comment
There was a problem hiding this comment.
Ran this at a59a9baf on Windows 11: python -I tests/test_progress_dashboard.py -> 27 tests, OK; git diff --check clean.
The dashboard's text output is published through a unique temp file and rename; the existing tests pass. No blocking issue.
|
Tested
No GPU, no game data. AI-assisted. |
|
Tested
AI-assisted (Devin). |
|
Tested a59a9ba merged with main 03b09a0 on Linux (WSL2), Python 3.12.16: pass. |
|
Merges cleanly into main 3faac55. All 27 tests pass under python -I and pytest, and your new case is a genuine regression test — dropped into a clean main worktree it fails with IsADirectoryError on the fixed .tmp name, green with your per-PID fix (re-run both sides). The write pins encoding and newline, published_mode is the existing helper, and nothing else consumes the old fixed tmp name. One nit: the cleanup does chmod then unlink inside a single except OSError, so a chmod failure skips the unlink and leaks the staging file — the same shape flagged in #4516, and main's tools/saves.py cleanup has it too (confirmed in main's source), so a repo-wide split into separate try/except blocks would be the tidy fix. Checks were still queued. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
Self-found CPU-only BUILD item, claimed narrowly on the coordination board (comment). This is not BUILD-1283 (D3D item counts) or the treemap-palette item; it changes only
save_text().What was wrong
tools/progress_dashboard.py::save_text()wrote through the fixed namepath + ".tmp". If a stale directory or a concurrent dashboard run held that name,open(..., "w")raisedPermissionErrorand an otherwise validprogress.html/JSON could not be refreshed.What changed
tempfile.mkstempin the output directory, keeping atomicos.replace().file_mode.published_mode().0600in the failure path before unlinking, so a read-only destination cannot strand a temp file on Windows.Tested
Windows, Python 3.12, no GPU/game data:
python -I tests/test_progress_dashboard.py: 27/27 OK (26/27 before the tool change; only the new case failed withPermissionError).python -I -m compileall -qon both changed files: exit 0.AI-assisted. No game files, keys or decryption.