Any other unlistable folder is left to the scan, which stops on it with exit 1,
so the result no longer depends on whether the report already exists.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When --out names an existing file, main() walks every source and mount
folder to make sure the report would not overwrite an input. That
os.walk had no onerror, so a sub-folder it could not list was skipped
and the check passed without having looked inside it: a report file in
that folder could be overwritten.
This is a safety check, so a folder it cannot list is an error: the
walk's onerror calls ap.error, which names the folder and exits 2
before anything is written, like the other "--out would overwrite ..."
refusals. The discovery walk in mount_documents() is left to #4176,
which already makes it fail on an unlistable folder.
The test forces os.scandir to raise PermissionError for one sub-folder
(chmod cannot lock a folder on Windows) and checks the exit code, the
folder in the message and that the existing report is untouched.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Before the previous commit, bink_index wrote a nested source as "movies\x.bk2" on Windows, and
load_pins keys pins on the exact (source, offset), so a pins CSV or an index CSV/JSON made that way
would no longer match the "/" sources. load_pins and load_streams now turn "\" into "/" in the source
they read. Pointed out by JRamos1993 in the review.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Do not classify contradicted name-stream pairs (unary < 0) or pairs only
adjacent to a contradicted sibling as "anchored" or "bracketed" in classify().
- Include _4k in FAMILY_TAIL so 4k clip names match their family siblings.
- Reject empty or whitespace/pipe-only pin rows in load_pins(), normalize backslashes
and $(common)/movies/ prefixes, and reject negative offsets.
- Reject booleans, floats, negative offsets, and non-positive stream sizes,
dimensions, or frame counts in _int() and load_streams().
- Add synthetic regression tests and negative controls in tests/test_bink_names.py.
AI-assisted with Argon (Antigravity).
open(path, "w") without newline= turns each \n into \r\n on Windows, so the same JSON report, manifest or assembly
listing was CRLF there and LF elsewhere. 91 text-mode writes (open, os.fdopen, Path.write_text) under tools/, scripts/,
make_game.py and runtime/test/shaders/ now pass newline="\n". tests/test_text_write_line_endings.py reads the source
with ast and fails for a writer that forgets it; CONTRIBUTING.md names the convention.
AI-assisted (Claude), on behalf of dev-ewann.
csv.writer and csv.DictWriter default to lineterminator="\r\n", and every
one of these tools opens its report with newline="", which turns that into
CRLF on Windows and LF elsewhere: the same archive gave different report
bytes depending on the machine that exported it. awc_manifest and awc_shorts
already pin "\n" and bink_index documents why its stdout writer needs it, so
this brings the remaining 16 writers onto the same convention. A structural
test keeps new writers on it, and three tools are run end to end to check the
bytes.
Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
- d3d12_compute_test and d3d12_draw_test (built when glslangValidator is found) had no add_test, which
test_ctest_registration catches; registered like their neighbours (exit 77 is a skip).
- awc_names.py (#1421) and bink_names.py (#1403) are new tools without #1428's stdout errors='replace' guard.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The RPF9 TOC is encrypted, but each pack's CDataFileMgr__ContentChangeSetDef
mount list names its videos, and the archive stores them in the list's
lowercase-path order. bink_names.py aligns the sorted list with the streams
from bink_index.py (a monotone DP that may skip list entries held by other
packs), scores header facts (resolution hints, portrait snapmatic, family
siblings sharing a shape), and labels each row verified / anchored /
bracketed / positional. Mount lists are read from an archive or an
rpf9_carve.py directory through gamedata_index, so a list split over two
zlib streams stays whole.
On 1.0.2.1 it names all 797 streams in movies.rpf, story000.rpf,
story000_restofworld.rpf and core_restofworld.rpf. Tests are synthetic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>