make_game: an undecodable byte in dotnet --list-sdks no longer stops preflight (BUILD-DOTNET-SDKS-DECODE) #1003

Merged
Snooozs merged 1 commit from upstream-pr/1003 into main 2026-11-25 02:36:02 +00:00
Snooozs commented 2026-11-24 16:43:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Snooozs on 2026-11-24T16:43:51Z.


Claimed in the coordination issue as: BUILD-DOTNET-SDKS-DECODE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7137887651)

What and why

make_game.py dotnet_sdk_ok() reads dotnet --list-sdks with text=True and no errors=. If an SDK path holds a byte the locale cannot decode (for example a UTF-8 letter such as Ł on a cp1252 Windows), the reader thread fails, stdout is None, and preflight stops with TypeError: expected string or bytes-like object, got 'NoneType'. It now passes errors="replace", as neighbouring calls do. Only the leading version number is parsed, so a replaced character changes nothing.

Found with a synthetic child process; I have not seen it on a real installation.

Tested

New tests/test_make_game_dotnet_sdk.py: a real child process writes the raw bytes through the real subprocess.run. Windows 10 Pro 22H2 (19045), CPython 3.12.10:

  • main's make_game.py: Ran 5 tests ... FAILED (errors=2)
  • with the change: Ran 5 tests ... OK
  • test_make_game_preflight (98 OK, 2 skipped), test_make_game_pipeline_preflight, test_make_game_argparse, test_make_game_dry_run: OK; compileall, test_text_write_line_endings, check_no_game_data.py: clean

GPUs tested: n/a

AI-assisted: yes. Claude Code (a Haiku 5.5 subagent found the cause and wrote the change, Claude Opus 5.5 reviewed it and reran the tests).

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator rule)

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5476416439 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1003). Originally posted by [Snooozs](https://github.com/Snooozs) on 2026-11-24T16:43:51Z. --- Claimed in the coordination issue as: BUILD-DOTNET-SDKS-DECODE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7137887651) ### What and why `make_game.py` `dotnet_sdk_ok()` reads `dotnet --list-sdks` with `text=True` and no `errors=`. If an SDK path holds a byte the locale cannot decode (for example a UTF-8 letter such as Ł on a cp1252 Windows), the reader thread fails, stdout is None, and preflight stops with `TypeError: expected string or bytes-like object, got 'NoneType'`. It now passes `errors="replace"`, as neighbouring calls do. Only the leading version number is parsed, so a replaced character changes nothing. Found with a synthetic child process; I have not seen it on a real installation. ### Tested New `tests/test_make_game_dotnet_sdk.py`: a real child process writes the raw bytes through the real `subprocess.run`. Windows 10 Pro 22H2 (19045), CPython 3.12.10: - `main`'s `make_game.py`: `Ran 5 tests ... FAILED (errors=2)` - with the change: `Ran 5 tests ... OK` - `test_make_game_preflight` (98 OK, 2 skipped), `test_make_game_pipeline_preflight`, `test_make_game_argparse`, `test_make_game_dry_run`: OK; `compileall`, `test_text_write_line_endings`, `check_no_game_data.py`: clean GPUs tested: n/a AI-assisted: yes. Claude Code (a Haiku 5.5 subagent found the cause and wrote the change, Claude Opus 5.5 reviewed it and reran the tests). ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator rule) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fin-github commented 2026-11-24 21:32:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fin-github on 2026-11-24T21:32:44Z.

Review: COMMENTED


  • python -I tests/test_make_game_dotnet_sdk.py on the PR: 5 tests OK.
  • The same test file against main (4a50cafc7): the two undecodable-byte cases error, so the test catches the bug.

errors="replace" is the right size of fix: only the leading version number is parsed, so a replaced byte in a path
can't change the answer.

Optional, not for this PR: two other text-mode reads in make_game.py have no errors=. One is native_ask
(line 597), which reads the folder chosen in a kdialog/zenity dialog. That is a user path, so it can contain the same
kind of byte, and there the replaced text would be used as the folder. The other is checker_supports (line 2684);
its usage text is ASCII, so the risk there is low. If the first one is worth a look, it would fit as a finding: in
#14 rather than growing this PR.

Tested on Windows 11 Pro 26200, CPython 3.14.4, applied on main 4a50cafc7. No GPU or game files used. AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6047760147 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1003#pullrequestreview-6047760147). Originally posted by [fin-github](https://github.com/fin-github) on 2026-11-24T21:32:44Z. **Review:** COMMENTED --- - `python -I tests/test_make_game_dotnet_sdk.py` on the PR: 5 tests OK. - The same test file against `main` (4a50cafc7): the two undecodable-byte cases error, so the test catches the bug. `errors="replace"` is the right size of fix: only the leading version number is parsed, so a replaced byte in a path can't change the answer. Optional, not for this PR: two other text-mode reads in `make_game.py` have no `errors=`. One is `native_ask` (line 597), which reads the folder chosen in a kdialog/zenity dialog. That is a user path, so it can contain the same kind of byte, and there the replaced text would be used as the folder. The other is `checker_supports` (line 2684); its usage text is ASCII, so the risk there is low. If the first one is worth a look, it would fit as a `finding:` in #14 rather than growing this PR. Tested on Windows 11 Pro 26200, CPython 3.14.4, applied on main 4a50cafc7. No GPU or game files used. AI-assisted (Claude Code).
Snooozs commented 2026-11-24 21:48:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Snooozs on 2026-11-24T21:48:55Z.


Thanks for running it against main too. I posted the native_ask read as a finding: in #14 and kept this PR as it is.

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7145423967 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1003#issuecomment-7145423967). Originally posted by [Snooozs](https://github.com/Snooozs) on 2026-11-24T21:48:55Z. --- Thanks for running it against main too. I posted the `native_ask` read as a `finding:` in #14 and kept this PR as it is. AI-assisted (Claude Code, Claude Opus 5.5).
QemmHD commented 2026-11-25 02:36:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-25T02:36:00Z.


Merging.

Why merged: dotnet --list-sdks output is decoded with errors="replace", so a non-UTF-8 console doesn't crash the check.

Why it's good: Own tests: 5 passed. The consistency set shows 583 because its new test file matches test_make_game_*.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main b4b7756e8. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 3ff2a2adc (after #984): no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7150933346 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1003#issuecomment-7150933346). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-25T02:36:00Z. --- Merging. **Why merged:** `dotnet --list-sdks` output is decoded with errors="replace", so a non-UTF-8 console doesn't crash the check. **Why it's good:** Own tests: 5 passed. The consistency set shows 583 because its new test file matches test_make_game_*. Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main b4b7756e8. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 3ff2a2adc (after #984): no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1003
No description provided.