tests: check paths with non-ASCII characters in the child's own encoding (TEST-NON-ASCII-PATHS) #1269

Merged
TheGeogeo merged 1 commit from upstream-pr/1269 into main 2026-11-28 08:05:18 +00:00
TheGeogeo commented 2026-11-24 21:06:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-24T21:06:23Z.


Claimed in the coordination issue as: TEST-NON-ASCII-PATHS — https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144437085

What and why

Five tests fail on Windows when the temp folder's name has a non-ASCII character, as under an accented user name. Four decode a tool's piped output as UTF-8, while a child started with -I writes the ANSI code page, so the path they assert is never found. test_build_runtime_fallback.py decodes PowerShell's OEM output with the ANSI code page and stops on a decoding error or a wrong path.

Each of these children now writes UTF-8 (-X utf8, which -I keeps, or [Console]::OutputEncoding in the PowerShell probe). The cases put \u00f8 in their own path, so the fault shows with an ASCII temp folder too. No tool changes.

Tested

On Windows 11, Python 3.12.4, on main at 6261ca91 (1e9c868c; the ANSI and OEM code pages are 1252 and 850):

  • The five files pass: build_runtime_fallback 10, gamedata_blobs 8, gamedata_sps1 7, guest_scene_reference 6, script_qtable 10. Before this rebase (same patch), they also passed with TEMP set to a folder whose name has accents and spaces. On 66d4f5aa all five failed there and passed with an ASCII folder.
  • Negative control (before this rebase, same patch): with the encoding changes removed and the new paths kept, each of the five fails.
  • Merges with #714 and #876, which edit two of the files, are clean and the five files pass (before this rebase). Draft #320 conflicts with main on its own.
  • test_tool_stdout_encoding.py, test_text_write_line_endings.py, test_docs_links.py, test_docs_cli_flags.py, test_docs_encoding.py, compileall, git diff --check and the no-game-data check passed (before this rebase).

GPUs tested: n/a (CPU-only synthetic tests).

AI-assisted: yes (Claude Code).

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5480336445 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1269). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-24T21:06:23Z. --- Claimed in the coordination issue as: TEST-NON-ASCII-PATHS — https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144437085 ### What and why Five tests fail on Windows when the temp folder's name has a non-ASCII character, as under an accented user name. Four decode a tool's piped output as UTF-8, while a child started with `-I` writes the ANSI code page, so the path they assert is never found. `test_build_runtime_fallback.py` decodes PowerShell's OEM output with the ANSI code page and stops on a decoding error or a wrong path. Each of these children now writes UTF-8 (`-X utf8`, which `-I` keeps, or `[Console]::OutputEncoding` in the PowerShell probe). The cases put `\u00f8` in their own path, so the fault shows with an ASCII temp folder too. No tool changes. ### Tested On Windows 11, Python 3.12.4, on `main` at `6261ca91` (`1e9c868c`; the ANSI and OEM code pages are 1252 and 850): - The five files pass: build_runtime_fallback 10, gamedata_blobs 8, gamedata_sps1 7, guest_scene_reference 6, script_qtable 10. Before this rebase (same patch), they also passed with `TEMP` set to a folder whose name has accents and spaces. On `66d4f5aa` all five failed there and passed with an ASCII folder. - Negative control (before this rebase, same patch): with the encoding changes removed and the new paths kept, each of the five fails. - Merges with #714 and #876, which edit two of the files, are clean and the five files pass (before this rebase). Draft #320 conflicts with `main` on its own. - `test_tool_stdout_encoding.py`, `test_text_write_line_endings.py`, `test_docs_links.py`, `test_docs_cli_flags.py`, `test_docs_encoding.py`, `compileall`, `git diff --check` and the no-game-data check passed (before this rebase). GPUs tested: n/a (CPU-only synthetic tests). AI-assisted: yes (Claude Code). ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption.
PierreEbele commented 2026-11-25 14:44:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T14:44:35Z.


Reviewed 1e9c868c: ran the five touched test files on both the PR and a fresh main worktree on arm64 Linux (all pass; one Windows-only PowerShell test skips), and copied the PR's tests onto main: still pass. Simulated the Windows single-byte piped stderr with PYTHONIOENCODING=cp1252: the pre-PR child names "…ø.bin" in a line the tests' utf-8 decode mangles to U+FFFD (needle fails), while this PR's -I -X utf8 round-trips it, so the new tests do cover the fix. No findings. The PowerShell OEM half is Windows-only and untested here. AI-assisted review.

Recommendation: Merge

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7165743882 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1269#issuecomment-7165743882). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T14:44:35Z. --- Reviewed 1e9c868c: ran the five touched test files on both the PR and a fresh main worktree on arm64 Linux (all pass; one Windows-only PowerShell test skips), and copied the PR's tests onto main: still pass. Simulated the Windows single-byte piped stderr with PYTHONIOENCODING=cp1252: the pre-PR child names "…ø.bin" in a line the tests' utf-8 decode mangles to U+FFFD (needle fails), while this PR's `-I -X utf8` round-trips it, so the new tests do cover the fix. No findings. The PowerShell OEM half is Windows-only and untested here. AI-assisted review. **Recommendation:** Merge
OreoFR commented 2026-11-27 19:42:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-27T19:42:25Z.


Merge test and review, taken from the pool PRs MoonEyes had not checked yet. Main ec91d695c merged without conflict; the PR's test files run with the pins of tests/requirements.txt on Windows 11, Python 3.12 (venv). AI-assisted (Claude Code, Claude Opus 5.5).

  • Tests: with the PR 46 passed, 1 skipped; against main: 1 failed. The fix is shown.
  • Nit: the child is forced into UTF-8 mode (-X utf8) rather than decoded in its own encoding, so the title says a bit more than what is tested.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7226790987 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1269#issuecomment-7226790987). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-27T19:42:25Z. --- Merge test and review, taken from the pool PRs MoonEyes had not checked yet. Main ec91d695c merged without conflict; the PR's test files run with the pins of `tests/requirements.txt` on Windows 11, Python 3.12 (venv). AI-assisted (Claude Code, Claude Opus 5.5). - **Tests:** with the PR 46 passed, 1 skipped; against main: 1 failed. The fix is shown. - Nit: the child is forced into UTF-8 mode (`-X utf8`) rather than decoded in its own encoding, so the title says a bit more than what is tested.
DadaCap commented 2026-11-28 08:05:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T08:05:20Z.


Merged into main (merge commit 9234f6b0f), approved by DadaCap (maintainer). Thanks!

Checked before merging: Its tests went from 41 tests with 1 failure on main to 47 tests passing with this PR. The merge was pinned to the head commit that was tested (1e9c868cb).

AI-assisted (Claude Code), posted for DadaCap.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7236354762 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1269#issuecomment-7236354762). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T08:05:20Z. --- Merged into `main` (merge commit 9234f6b0f), approved by DadaCap (maintainer). Thanks! Checked before merging: Its tests went from 41 tests with 1 failure on main to 47 tests passing with this PR. The merge was pinned to the head commit that was tested (1e9c868cb). _AI-assisted (Claude Code), posted for DadaCap._
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!1269
No description provided.