[PR #2112] tests: decode the GPU work-directory error as UTF-8 on non-English Windows (TEST-WINDOWS-ANSI-STDERR) #2116

Open
opened 2026-11-26 21:20:06 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2112
Author: @MoonEyes
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: fix/run-gpu-tests-ansi-stderr


📝 Commits (3)

  • 3f41e58 tests: decode the GPU work-directory error as UTF-8 on non-English Windows
  • a270e95 Merge remote-tracking branch 'origin/main' into fix/run-gpu-tests-ansi-stderr
  • 92465a0 Merge remote-tracking branch 'origin/main' into fix/run-gpu-tests-ansi-stderr

📊 Changes

1 file changed (+4 additions, -2 deletions)

View changed files

📝 tests/test_run_gpu_tests_paths.py (+4 -2)

📄 Description

Claimed in the coordination issue as: TEST-WINDOWS-ANSI-STDERR (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7174699096)

What and why

WorkDirectory.test_file_blocking_work_directory_is_a_cli_error in tests/test_run_gpu_tests_paths.py runs
scripts/run_gpu_tests.py with -I and asserts on its stderr. That stderr quotes a localized OS error
("Impossible de créer un fichier déjà existant" on a French install). -I ignores PYTHONUTF8, so the child
wrote the message in the ANSI code page (cp1252), while a parent running with PYTHONUTF8=1 decoded the pipe
as UTF-8. The reader thread raised UnicodeDecodeError, result.stderr came back None, and both subtests
(blocked_child='' and 'spirv') failed with a TypeError before their assertions ran.

The child now runs with -X utf8 (which -I keeps) and the parent decodes with encoding="utf-8", so both sides
agree whatever the host locale or PYTHONUTF8 setting. Decoding stays strict, so a real mismatch would still show.
Test-only change; scripts/run_gpu_tests.py is untouched.

Tested

Windows 11 (French, ANSI code page cp1252), Python 3.14.0, python -m pytest tests/test_run_gpu_tests_paths.py:

  • main, PYTHONUTF8=1: 2 subtests fail (UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9, then
    TypeError: argument of type 'NoneType' is not a container or iterable at line 145).
  • main, without PYTHONUTF8: passes.
  • this branch, PYTHONUTF8=1: 21 passed, 7 subtests passed.
  • this branch, without PYTHONUTF8: 21 passed, 7 subtests passed.

GPUs tested: n/a (the test uses stand-in tool files; no GPU runs)

AI-assisted: yes (Claude Code)

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)

🤖 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/2112 **Author:** [@MoonEyes](https://github.com/MoonEyes) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/run-gpu-tests-ansi-stderr` --- ### 📝 Commits (3) - [`3f41e58`](https://github.com/ubiquitarianism/leonida/commit/3f41e58b6b09c29b42000114b16aa60d05d426dc) tests: decode the GPU work-directory error as UTF-8 on non-English Windows - [`a270e95`](https://github.com/ubiquitarianism/leonida/commit/a270e9534083536108e55533d4944c4ba85d5b64) Merge remote-tracking branch 'origin/main' into fix/run-gpu-tests-ansi-stderr - [`92465a0`](https://github.com/ubiquitarianism/leonida/commit/92465a0847292753c72b10f7e8578236f2ff44cb) Merge remote-tracking branch 'origin/main' into fix/run-gpu-tests-ansi-stderr ### 📊 Changes **1 file changed** (+4 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_run_gpu_tests_paths.py` (+4 -2) </details> ### 📄 Description Claimed in the coordination issue as: TEST-WINDOWS-ANSI-STDERR (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7174699096) ### What and why `WorkDirectory.test_file_blocking_work_directory_is_a_cli_error` in `tests/test_run_gpu_tests_paths.py` runs `scripts/run_gpu_tests.py` with `-I` and asserts on its stderr. That stderr quotes a localized OS error ("Impossible de créer un fichier déjà existant" on a French install). `-I` ignores `PYTHONUTF8`, so the child wrote the message in the ANSI code page (cp1252), while a parent running with `PYTHONUTF8=1` decoded the pipe as UTF-8. The reader thread raised `UnicodeDecodeError`, `result.stderr` came back `None`, and both subtests (`blocked_child=''` and `'spirv'`) failed with a `TypeError` before their assertions ran. The child now runs with `-X utf8` (which `-I` keeps) and the parent decodes with `encoding="utf-8"`, so both sides agree whatever the host locale or `PYTHONUTF8` setting. Decoding stays strict, so a real mismatch would still show. Test-only change; `scripts/run_gpu_tests.py` is untouched. ### Tested Windows 11 (French, ANSI code page cp1252), Python 3.14.0, `python -m pytest tests/test_run_gpu_tests_paths.py`: - main, `PYTHONUTF8=1`: 2 subtests fail (`UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9`, then `TypeError: argument of type 'NoneType' is not a container or iterable` at line 145). - main, without `PYTHONUTF8`: passes. - this branch, `PYTHONUTF8=1`: 21 passed, 7 subtests passed. - this branch, without `PYTHONUTF8`: 21 passed, 7 subtests passed. GPUs tested: n/a (the test uses stand-in tool files; no GPU runs) AI-assisted: yes (Claude Code) ### 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) 🤖 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>
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#2116
No description provided.