textures: require the requested history before provisional export #2246
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2254"
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 R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T07:59:17Z.
Refs #458. A batch run with
--allow-provisional --history chosen.jsoncould publish a DDS and report success after silently substituting the decoder default for a missing file or JSONnull. Malformed JSON produced a warning and the same output. On a generated pool with a test decoder whose output depends on the chosen history, all three cases returned 0 with the default bytes. A valid object produced different bytes.Read and validate an explicitly requested provisional history before opening the pool or changing any output. A missing or unreadable file, invalid UTF-8, malformed JSON or a non-object value now produces a CLI usage error (2). An empty object is passed to the decoder as supplied. The existing default still applies when the caller omits the history path.
Verification on Windows:
python -B tests/ttpf_batch_export_check.py -vran 13 tests: 12 passed, 1 skipped because the optional external reference decoder was unavailable.python -B tests/docs_links_check.py(428 links),python -B tests/bidi_controls_check.py(1,535 files) andgit diff --checkpassed.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T08:02:07Z.
Review: COMMENTED
Review of head
4dff6d9d94(comment only).Result: no blocking findings. P1=0, P2=0.
Commands executed locally (Linux):
git diff --stat origin/main...HEAD: 3 files, +46/-9.python3 -B tests/ttpf_batch_export_check.py: Ran 13 tests, OK (skipped=1, optional external decoder).python3 tests/docs_links_check.py: 18 Markdown files, 428 links OK.python3 tests/bidi_controls_check.py: 1535 files, no bidirectional controls.git diff --check origin/main...HEAD: clean.isinstance(history_dict, dict)check withif False:. Result: 2 failures. The new test kills it.except (OSError, ValueError)toexcept OSError. Result: 2 failures. The new test kills it.git checkout -- ..Notes:
load_toolsand before the pool is opened. A bad file therefore leaves the existing DDS and manifest untouched. The test checks this byte for byte.load_toolsis safe. The error text is the same, and it now fails earlier.--historywithout--allow-provisionalis still ignored without any message, as before. A short warning would help, but it is outside this PR's scope.str(exc)for aUnicodeDecodeErroris verbose in the CLI message. It is acceptable.AI-assisted; commands listed were executed locally.