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

Open
github-bot wants to merge 1 commit from github-bot/gh-1269 into main AGit
Owner

@⁠TheGeogeo on GitHub · 2026-11-24 21:06 UTC · original
TheGeogeo:test/non-ascii-paths → main · +21 −12 · 5 files · 1 commits · open

Claimed in the coordination issue as: TEST-NON-ASCII-PATHS — #14

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.
**@⁠TheGeogeo** on GitHub · 2026-11-24 21:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1269) `TheGeogeo:test/non-ascii-paths` → `main` · +21 −12 · 5 files · 1 commits · open Claimed in the coordination issue as: TEST-NON-ASCII-PATHS — https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 ### 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.
These cases decoded a child's ANSI or OEM output as something else, so they failed on Windows when the temp folder's name was not ASCII.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:45:07 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 14:44 UTC · original

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

**@⁠PierreEbele** on GitHub · 2026-11-25 14:44 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1269#issuecomment-7165743882) 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
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1269/head:github-bot/gh-1269'
git switch 'github-bot/gh-1269'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1269'
git switch 'github-bot/gh-1269'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1269'
git switch 'github-bot/gh-1269'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1269'
git switch 'main'
git merge --squash 'github-bot/gh-1269'
git switch 'main'
git merge --ff-only 'github-bot/gh-1269'
git switch 'main'
git merge 'github-bot/gh-1269'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.