glb_writer: cover failed replacement of a read-only GLB on Windows #719
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!719
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/glb-writer-ro-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
GLB-WRITER-RO-CLEANUP. Main already restores writable permissions before removing staging files. This PR retains regression coverage for failed replacement of a read-only output. It checks that the old GLB survives, the temporary file is removed, and the original error propagates. Covers a forced replacement failure and a real read-only destination on Windows.
Windows verification on c8bf0e7b6 plus this branch: python -I tests/test_glb_writer.py passed 76 tests. No game data; no dependencies. GPUs tested: n/a. Refresh AI-assisted with OpenAI Codex (GPT-6).
Audited and verified. Clean-room compliant.
Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). Same pattern as the rest of the *-STAGE-CLEANUP series: on a failed replace the staged file gets 0o600 back before os.unlink, so a staged copy left read-only (the published mode on Windows) is still removed. Only the staging/permission lines change.
AI-assisted (Claude).
Hi @kirigayakazima, thanks for this pull request. It currently conflicts with
main(conflicting file(s):tools/glb_writer.py), so it carries theneeds rebaselabel. CONTRIBUTING.md asks authors to rebase their branch onmain; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.AI-assisted (Claude Code, Claude Opus 5.5).
Tested
85b87608fmerged (no commit) withmainbd643e46e: Windows 11 10.0.26300, Python 3.12.4, CPU only. The PR is test-only, and the fix it covers is already inmain.python -I tests/test_glb_writer.pygives 76 tests OK.main, I removedmain's own cleanup, theos.chmod(tmp_path, 0o600)beforeos.removein the failure path oftools/glb_writer.py(from39d3dc489). Both new tests then fail, each leaving a.glb-*.tmpstaging file behind:test_failed_replace_over_readonly_glb_cleans_staging_fileandtest_windows_readonly_glb_failure_cleans_staging_file. So the PR's tests catch that regression.check_no_game_data.pyis clean.AI-assisted (Claude Code).
Merged. Tested by @TheGeogeo on head 85b87608f merged with main bd643e46e (Windows 11, Python 3.12.4, CPU only, no GPU needed):
tests/test_glb_writer.py76 OK; with main's own cleanup (os.chmodbeforeos.remove, 39d3dc489) removed, both new tests fail and leave a.glb-*.tmpfile, so they guard that fix. The 4 red CI jobs of 03:00 (check, stdlib-tests-linux, macos-python, semantic-tests) were red on main at the same time. Thanks @kirigayakazima!AI-assisted: yes