[PR #482] [MERGED] PREFLIGHT-TOOL-AVAILABLE-SPACES: parse quoted paths with spaces in make_game.tool_available #532

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/482
Author: @xroneyaa
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142

Base: main ← Head: fix/make-game-tool-available-spaces


📝 Commits (1)

  • 2c03f29 make_game: parse quoted paths with spaces in tool_available

📊 Changes

2 files changed (+19 additions, -5 deletions)

View changed files

📝 make_game.py (+6 -5)
📝 tests/test_make_game_preflight.py (+13 -0)

📄 Description

Claimed in the coordination issue as: PREFLIGHT-TOOL-AVAILABLE-SPACES

What and why

make_game.tool_available() previously stripped outer quotes and split on whitespace (cmd.split()[0]). When passed a quoted path containing spaces plus arguments (such as "C:\Program Files\Python312\python.exe" -I), it split at the first space (C:\Program) and reported an available tool as missing, failing ToolchainDetectionTest.test_tool_available_command_with_arguments on Windows systems where Python is installed under Program Files.

This reuses tools/mc_command.py's split_command() so quoted paths with spaces and arguments resolve to their executable path, unquoted paths with spaces still resolve via os.path.isfile(), and unmatched quotes return False without raising SystemExit. Added space-in-path and unmatched-quote regression tests in tests/test_make_game_preflight.py.

Tested

  • python -I -m compileall -q make_game.py tests -> exit 0
  • python -I tests/test_make_game_preflight.py -> Ran 100 tests, OK (skipped=1)
  • python -I tests/test_make_game_argparse.py -> Ran 38 tests, OK
  • python -I tests/test_text_write_line_endings.py -> Ran 3 tests, OK
  • python -I scripts/check_no_game_data.py make_game.py tests/test_make_game_preflight.py -> exit 0

GPUs tested: n/a

AI-assisted: yes

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 added).

🔄 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/482 **Author:** [@xroneyaa](https://github.com/xroneyaa) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `fix/make-game-tool-available-spaces` --- ### 📝 Commits (1) - [`2c03f29`](https://github.com/ubiquitarianism/leonida/commit/2c03f297836014068693dd6f71a2e2c93d22eae3) make_game: parse quoted paths with spaces in tool_available ### 📊 Changes **2 files changed** (+19 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `make_game.py` (+6 -5) 📝 `tests/test_make_game_preflight.py` (+13 -0) </details> ### 📄 Description Claimed in the coordination issue as: PREFLIGHT-TOOL-AVAILABLE-SPACES ### What and why `make_game.tool_available()` previously stripped outer quotes and split on whitespace (`cmd.split()[0]`). When passed a quoted path containing spaces plus arguments (such as `"C:\Program Files\Python312\python.exe" -I`), it split at the first space (`C:\Program`) and reported an available tool as missing, failing `ToolchainDetectionTest.test_tool_available_command_with_arguments` on Windows systems where Python is installed under `Program Files`. This reuses `tools/mc_command.py`'s `split_command()` so quoted paths with spaces and arguments resolve to their executable path, unquoted paths with spaces still resolve via `os.path.isfile()`, and unmatched quotes return `False` without raising `SystemExit`. Added space-in-path and unmatched-quote regression tests in `tests/test_make_game_preflight.py`. ### Tested - `python -I -m compileall -q make_game.py tests` -> exit 0 - `python -I tests/test_make_game_preflight.py` -> Ran 100 tests, OK (skipped=1) - `python -I tests/test_make_game_argparse.py` -> Ran 38 tests, OK - `python -I tests/test_text_write_line_endings.py` -> Ran 3 tests, OK - `python -I scripts/check_no_game_data.py make_game.py tests/test_make_game_preflight.py` -> exit 0 GPUs tested: n/a AI-assisted: yes ### 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. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed (n/a — no translator rule added). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:11 +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#532
No description provided.