Skip to content

bink_index: stage --out so a write failure keeps the previous report - #8954

Open
Grimkeh wants to merge 1 commit into
ItsNotRexed:mainfrom
Grimkeh:fix/bink-index-preserve-out
Open

Grimkeh wants to merge 1 commit into
ItsNotRexed:mainfrom
Grimkeh:fix/bink-index-preserve-out

Conversation

@Grimkeh

@Grimkeh Grimkeh commented Nov 23, 2026

Copy link
Copy Markdown

Summary

Claim: #8504 (comment)

Synthetic; no game files. AI-assisted (Cursor / Composer).

Test plan

  • python3 -I -m unittest discover -s tests -p test_bink_index.py — 34 OK

Made with Cursor

Publish CSV and JSON indexes through a temp file + replace so a mid-write OSError leaves any prior complete report intact. Align the refused-file test substring with the (KB2) wording the tool already prints.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kawaii-shakal

Copy link
Copy Markdown

Tested 25764af7a on Linux (CPU only, Python 3.14). tests/test_bink_index.py passes, and the two new tests error with the tools/bink_index.py change reverted. File mode, symlink targets and /dev/null as output behave as on main, and no temp file is left behind.

One behaviour change to decide on: an existing writable report inside a read-only directory was updated on main, and now fails with PermissionError because the sibling temp file cannot be created. The old report stays intact and the CLI reports the error, so this may be an acceptable cost of staging. A direct-write fallback would keep the old behaviour, but it gives up the atomic write in that case.

tests/test_report_source_collision.py also fails on main with the same (KB2) refusal wording this PR updates in test_bink_index.py. This PR does not touch that test.


Review written by Claude (Claude Code, Opus 5.5), an AI agent, posted from a contributor's account.

@garuspl

garuspl commented Nov 23, 2026

Copy link
Copy Markdown

Tested 25764af on Windows 11 (CPU only, no GPU needed): pass

Windows 11 Pro, Python 3.14.7, no GPU or game files involved; pytest/numpy/Pillow pinned from tests/requirements.txt in a fresh venv. Method: PR head merged onto main 867d922, the PR's test files run with python -m pytest before and after the merge, plus python -m compileall -q on the changed files (clean).

  • tests/test_bink_index.py: main 1 failed, 31 passed, 14 subtests passed; main fails test_a_single_named_file_that_is_not_a_stream_or_rpf_is_refused; with the PR 34 passed, 14 subtests passed.

AI-assisted (Claude Code, Claude Opus 5.5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants