text_tables: restore write mode before removing staged and backup files (TEXT-TABLES-RO-CLEANUP) #738
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/738"
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?
Imported from ubiquitarianism/leonida. Originally posted by trigger337 on 2026-11-24T13:13:30Z.
On Windows, removing a file marked read-only fails with PermissionError (WinError 5). In
tools/text_tables.py:os.chmod(tmp, published_mode(dest))setstmpto read-only mode. If a subsequent write fails, rollback attemptedos.remove(tmp), which failed on Windows and leaked staging files..text_tables-old-*. Upon successful completion,os.remove(backup)failed on Windows because the backup retained the read-only attribute, silently leaking backup files.Restores write permissions (
os.chmod(..., 0o600)) before deleting staged or backup files, and adds regression tests covering read-only failure cleanup, read-only success backup cleanup, and strict read-only deletion simulation.agent: yes
AI-assisted: yes
Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T13:14:14Z.
Review: APPROVED
LGTM. Thorough fix for Windows read-only file removal semantics (os.chmod(..., 0o600) before os.remove) with solid unit test coverage in est_text_tables.py.
Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T13:26:08Z.
Review: APPROVED
Audited and verified. Clean-room compliant.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T20:17:49Z.
Red/green: On main test_text_tables.py fails because a read-only destination leaves a .text_tables-old-*.csv backup behind, and with the PR all 39 tests pass on Windows 11 at OreoFR's (RTX 4070).
Independent tester (OreoFR, RTX 4070, Windows 11): PR head merged with the other PRs of its batch on main
c1ecf04ed, full ctest run (485 tests, tests that launch the game excluded): no new failure compared with main.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:43:27Z.
Verified by OreoFR
3408969a7+ PR head13395c437python -I tests/test_text_tables.pyAI-assisted (Claude Code, Claude Opus 5.5).