Skip to content

bink_index: the output-overwrite check comes from tools/report_paths.py - #6069

Open
Koro4e wants to merge 2 commits into
ItsNotRexed:mainfrom
Koro4e:bink-index-report-paths
Open

Koro4e wants to merge 2 commits into
ItsNotRexed:mainfrom
Koro4e:bink-index-report-paths

Conversation

@Koro4e

@Koro4e Koro4e commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as this finding, from DeepSeek5's report.

What and why

tools/bink_index.py's same_output_path reimplemented the report-overwrite check with realpath + normcase + samefile and missed tools/report_paths.py's normalization rule, so on a case-insensitive macOS volume --out naming an input in the composed/accent-decomposed spelling of one file could truncate it. The function now forwards to same_report_path (the rules the other report tools use); tools/bink_names.py:368 inherits the fix through the same function. bink_index already needed no extra sys.path work beyond the shared insert the other tools do.

Two commits: the tool, then the test.

Tested

  • python -m pytest tests/test_bink_index.py -q: 27 passed, 14 subtests passed (new test_the_output_guard_asks_report_paths); tests/test_bink_names.py has one pre-existing failure on this Windows host (test_unreadable_mount_directory_preserves_the_report prints the path through repr, doubling the backslashes - the same message-shape PR tools: print a refused or unreadable path as typed, not through repr() (5 tests fail on Windows) #5927 is fixing), and it fails identically with and without this branch.
  • The new test pins the delegation contract (the macOS folding-volume case, simulated as tests/test_report_paths.py does): it passes on main as well on this host, because Windows' own normcase already folds case - the behavioral gap this closes shows where normcase does not (macOS/Linux hosts).
  • Manual: a hard link of the input is still refused (samefile inside same_report_path), a distinct name still passes.

Windows 11, Python 3.12.10, CPU only. No game files.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md).
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator changes.)

…h (finding by DeepSeek5)

The local copy took realpath+normcase+samefile and missed report_paths' normalization rule (a folding volume's NFD/case-fold path_key and the same-name probe), so on a case-insensitive macOS volume --out naming the input in a composed/accent-decomposed spelling could truncate it. The shared rules own this check; bink_names.py inherits the fix through the same function.
@Atomic258

Copy link
Copy Markdown
Contributor

Tested 27ae8e8b on Windows Server 2022, CPython 3.13.12: pass

  • PYTHONPATH=tools python tests/test_bink_index.py -> OK (the new top-level import report_paths needs tools/ on sys.path; plain python -I cannot resolve it from the tests dir)

git diff --check clean; python -m compileall -q exit 0. No game files, no GPU. AI-assisted (Devin).

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.

2 participants