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

Closed
opened 2026-11-26 20:19:53 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1003
Author: @Snooozs
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @QemmHD

Base: main ← Head: dotnet-sdks-decode


📝 Commits (1)

  • 6c6c6ca BUILD-DOTNET-SDKS-DECODE: decode dotnet --list-sdks with errors="replace"

📊 Changes

2 files changed (+65 additions, -1 deletions)

View changed files

📝 make_game.py (+1 -1)
➕ tests/test_make_game_dotnet_sdk.py (+64 -0)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1003 **Author:** [@Snooozs](https://github.com/Snooozs) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `dotnet-sdks-decode` --- ### 📝 Commits (1) - [`6c6c6ca`](https://github.com/ubiquitarianism/leonida/commit/6c6c6ca868f9b7b864e1c3db3294a25fdc1333ee) BUILD-DOTNET-SDKS-DECODE: decode `dotnet --list-sdks` with errors="replace" ### 📊 Changes **2 files changed** (+65 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `make_game.py` (+1 -1) ➕ `tests/test_make_game_dotnet_sdk.py` (+64 -0) </details> ### 📄 Description 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:19:53 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1040
No description provided.