progress_dashboard: hide a whole drive path that contains spaces (DASH-SCRUB-SPACES) #1274

Open
github-bot wants to merge 2 commits from github-bot/gh-1274 into main AGit
Owner

@⁠TheGeogeo on GitHub · 2026-11-24 21:10 UTC · original
TheGeogeo:fix/dashboard-scrub-spaces → main · +33 −2 · 2 files · 2 commits · open

Claimed in the coordination issue as: DASH-SCRUB-SPACES — #14

What and why

scrub() in tools/progress_dashboard.py replaces absolute paths outside the repository, file name included, before a line of output reaches the dashboard page. A Windows path that contains a space was only replaced up to the space: cannot read D:\My work\shaders\<name>.fssm became cannot read <path> work\shaders\<name>.fssm, so a carved shader's name stayed in the text. test_progress_dashboard.py showed it by failing when the temp folder has a space in its name.

  • An unquoted drive path now goes on over spaces while a later part still has its separator. The text after the path stays: D:\work\a.txt is not a folder is still <path> is not a folder.
  • The other Windows separator also continues an unquoted path (D:/My work\fixtures\a.txt, D:\My work/stubs/a.spv), but only after a part with no dot or punctuation, so D:\work\a.txt is 3/4 done keeps its prose.
  • A quoted drive path ends at its closing quote, so a file name with spaces is covered there too.

Limits: an unquoted path whose last part has a space (D:\My work\my file.txt) keeps the text after that last space, and so does a bare C:\Users\First Last. Text that follows an unquoted path and contains another path with the same separator is replaced with it, and so is text with any slash after a part with no dot or punctuation (D:\work has 3/4 files). With the other separator, a folder name that has a dot right before a space (D:\My.data dir/x.fssm) still ends the path. POSIX paths are unchanged.

Tested

Head db3f77d4, rebased on main e18b59a5, same patch as f36f661e (git range-diff); it merges cleanly with main 747809e7. Windows 11, Python 3.12.4:

  • python -I -B tests/test_progress_dashboard.py: 52 OK. With this test on the tool of main e48ff037, it has 11 failures, all in test_drive_paths_with_spaces_lose_their_whole_name.
  • tests/test_docs_cli_flags.py, tests/test_text_write_line_endings.py, tests/test_ctest_registration.py, tests/test_ci_registration.py and tests/test_docs_links.py: OK.
  • tests/test_tool_stdout_encoding.py fails in test_every_main_block_reconfigures_stdout, as on main e18b59a5 alone (three tools this change does not touch).
  • compileall, git diff --check and python -I scripts/check_no_game_data.py on the two files: clean.

Earlier head, on Windows 11, Python 3.12.4, on main at 6261ca91 (f36f661e):

  • python -I -B tests/test_progress_dashboard.py — 52 OK, and also with TEMP set to folders whose names have a space, accents, or both. With the new test and the tool from before this pull request, the new test has 11 failures (10 subtests and the Windows sibling case). The four mixed-separator cases fail on 7c001c7f.
  • The drive-path cases also pass with os.name patched to posix.
  • Merges with main 4a50cafc (52 OK), #1256 (c81b2daf, 59 OK), #625 (3c2ad30d, 57 OK) and #1001 (e98b345c, 52 OK) are clean.
  • test_tool_stdout_encoding.py, test_text_write_line_endings.py, test_docs_links.py, test_docs_cli_flags.py, compileall, git diff --check and the no-game-data check passed.

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:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1274) `TheGeogeo:fix/dashboard-scrub-spaces` → `main` · +33 −2 · 2 files · 2 commits · open Claimed in the coordination issue as: DASH-SCRUB-SPACES — https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 ### What and why `scrub()` in `tools/progress_dashboard.py` replaces absolute paths outside the repository, file name included, before a line of output reaches the dashboard page. A Windows path that contains a space was only replaced up to the space: `cannot read D:\My work\shaders\<name>.fssm` became `cannot read <path> work\shaders\<name>.fssm`, so a carved shader's name stayed in the text. `test_progress_dashboard.py` showed it by failing when the temp folder has a space in its name. - An unquoted drive path now goes on over spaces while a later part still has its separator. The text after the path stays: `D:\work\a.txt is not a folder` is still `<path> is not a folder`. - The other Windows separator also continues an unquoted path (`D:/My work\fixtures\a.txt`, `D:\My work/stubs/a.spv`), but only after a part with no dot or punctuation, so `D:\work\a.txt is 3/4 done` keeps its prose. - A quoted drive path ends at its closing quote, so a file name with spaces is covered there too. Limits: an unquoted path whose last part has a space (`D:\My work\my file.txt`) keeps the text after that last space, and so does a bare `C:\Users\First Last`. Text that follows an unquoted path and contains another path with the same separator is replaced with it, and so is text with any slash after a part with no dot or punctuation (`D:\work has 3/4 files`). With the other separator, a folder name that has a dot right before a space (`D:\My.data dir/x.fssm`) still ends the path. POSIX paths are unchanged. ### Tested Head `db3f77d4`, rebased on `main` `e18b59a5`, same patch as `f36f661e` (`git range-diff`); it merges cleanly with `main` `747809e7`. Windows 11, Python 3.12.4: - `python -I -B tests/test_progress_dashboard.py`: 52 OK. With this test on the tool of `main` `e48ff037`, it has 11 failures, all in `test_drive_paths_with_spaces_lose_their_whole_name`. - `tests/test_docs_cli_flags.py`, `tests/test_text_write_line_endings.py`, `tests/test_ctest_registration.py`, `tests/test_ci_registration.py` and `tests/test_docs_links.py`: OK. - `tests/test_tool_stdout_encoding.py` fails in `test_every_main_block_reconfigures_stdout`, as on `main` `e18b59a5` alone (three tools this change does not touch). - `compileall`, `git diff --check` and `python -I scripts/check_no_game_data.py` on the two files: clean. Earlier head, on Windows 11, Python 3.12.4, on `main` at `6261ca91` (`f36f661e`): - `python -I -B tests/test_progress_dashboard.py` — 52 OK, and also with `TEMP` set to folders whose names have a space, accents, or both. With the new test and the tool from before this pull request, the new test has 11 failures (10 subtests and the Windows sibling case). The four mixed-separator cases fail on `7c001c7f`. - The drive-path cases also pass with `os.name` patched to `posix`. - Merges with `main` `4a50cafc` (52 OK), #1256 (`c81b2daf`, 59 OK), #625 (`3c2ad30d`, 57 OK) and #1001 (`e98b345c`, 52 OK) are clean. - `test_tool_stdout_encoding.py`, `test_text_write_line_endings.py`, `test_docs_links.py`, `test_docs_cli_flags.py`, `compileall`, `git diff --check` and the no-game-data check passed. 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.
scrub() stopped at the first space, so the rest of a path outside the repository, file name included, stayed in the text.
`D:/My work\name` and `D:\My work/name` were replaced only up to the space, so the file name stayed in the text.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:45:22 +00:00
Author
Owner

@⁠DeadlyChirp on GitHub · 2026-11-24 21:36 UTC · original

On Windows, the filename still appears in the dashboard when the drive prefix uses a forward slash and the rest of the path comes from os.path.join. I reproduced this on 7c001c7 with Python 3.12.10. From the repo root, run the following in Python:

import os, runpy
scrub = runpy.run_path("tools/progress_dashboard.py")["scrub"]
p = os.path.join("D:/My work", "fixtures", "example.txt")
print(scrub("cannot read " + p))
print(scrub("cannot read " + os.path.normpath(p)))

The first call prints cannot read <path> work\fixtures\example.txt. The second prints the expected cannot read <path>. Both strings name the same external path, and the filename contains no spaces. The unquoted drive pattern picks a separator at the drive prefix and requires that same separator after the space. Could the continuation accept either Windows separator? The first call would make a regression test without touching the filesystem.

AI-assisted review, verified locally with synthetic paths.

**@⁠DeadlyChirp** on GitHub · 2026-11-24 21:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1274#issuecomment-7145154839) On Windows, the filename still appears in the dashboard when the drive prefix uses a forward slash and the rest of the path comes from os.path.join. I reproduced this on 7c001c7 with Python 3.12.10. From the repo root, run the following in Python: ```python import os, runpy scrub = runpy.run_path("tools/progress_dashboard.py")["scrub"] p = os.path.join("D:/My work", "fixtures", "example.txt") print(scrub("cannot read " + p)) print(scrub("cannot read " + os.path.normpath(p))) ``` The first call prints `cannot read <path> work\fixtures\example.txt`. The second prints the expected `cannot read <path>`. Both strings name the same external path, and the filename contains no spaces. The unquoted drive pattern picks a separator at the drive prefix and requires that same separator after the space. Could the continuation accept either Windows separator? The first call would make a regression test without touching the filesystem. AI-assisted review, verified locally with synthetic paths.
Author
Owner

@⁠TheGeogeo on GitHub · 2026-11-24 21:49 UTC · original

Thanks, reproduced on Windows 11, Python 3.12.4, and fixed in f36f661e. The reverse case (D:\My work/stubs/<name>, the shape vk_pipeline_check.cpp builds) leaked the same way, so it is covered too.

  • The continuation now accepts either separator. The other separator continues the path only after a part with no dot or punctuation, so D:\work\a.txt, then tests/test_x.py failed and D:\work\a.txt is 3/4 done keep their prose.
  • Your first call is in the test, with the reverse form and two longer mixes. The four new path cases fail on 7c001c7f and pass now.
  • tests/test_progress_dashboard.py 52 OK, also with TEMP in folders with a space, accents, or both. Merged with main 4a50cafc, #1256, #625 and #1001: clean, 52, 59, 57 and 52 OK. test_tool_stdout_encoding.py, test_text_write_line_endings.py, test_docs_links.py, test_docs_cli_flags.py, the no-game-data check and git diff --check pass.
  • Limits: a folder name with a dot right before a space still ends the path when the separator changes, and a word with a slash after an extensionless path is replaced with it. Both are in the description.

AI-assisted: yes (Claude Code).

**@⁠TheGeogeo** on GitHub · 2026-11-24 21:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1274#issuecomment-7145444470) Thanks, reproduced on Windows 11, Python 3.12.4, and fixed in `f36f661e`. The reverse case (`D:\My work/stubs/<name>`, the shape `vk_pipeline_check.cpp` builds) leaked the same way, so it is covered too. - The continuation now accepts either separator. The other separator continues the path only after a part with no dot or punctuation, so `D:\work\a.txt, then tests/test_x.py failed` and `D:\work\a.txt is 3/4 done` keep their prose. - Your first call is in the test, with the reverse form and two longer mixes. The four new path cases fail on `7c001c7f` and pass now. - `tests/test_progress_dashboard.py` 52 OK, also with `TEMP` in folders with a space, accents, or both. Merged with `main` `4a50cafc`, #1256, #625 and #1001: clean, 52, 59, 57 and 52 OK. `test_tool_stdout_encoding.py`, `test_text_write_line_endings.py`, `test_docs_links.py`, `test_docs_cli_flags.py`, the no-game-data check and `git diff --check` pass. - Limits: a folder name with a dot right before a space still ends the path when the separator changes, and a word with a slash after an extensionless path is replaced with it. Both are in the description. AI-assisted: yes (Claude Code).
Author
Owner

@⁠TheGeogeo on GitHub · 2026-11-25 19:50 UTC · original

Rebased from f36f661e to db3f77d4 on main e18b59a5, same patch (git range-diff): the two commits are unchanged. The old base was why test_ctest_registration.py failed in this pull request's CI (vk_host_region_import_test.cpp:341); it passes on the new base. The mixed-separator case reported by DeadlyChirp is still fixed by the second commit (f36f661e, now db3f77d4).

Windows 11, Python 3.12.4: test_progress_dashboard.py 52, test_ctest_registration.py 5, test_ci_registration.py 16 and test_docs_links.py 16 pass, test_docs_cli_flags.py and test_text_write_line_endings.py too. Not from this change: test_tool_stdout_encoding.py, test_bink_names.py, test_opus_tags.py and test_world_names.py fail on main alone as well, and the two cs_dpp_cmp.asm cases of the old CI run are unchanged on main (not run here: no llvm-mc).

AI-assisted: yes (Claude Code)

**@⁠TheGeogeo** on GitHub · 2026-11-25 19:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1274#issuecomment-7172834295) Rebased from `f36f661e` to `db3f77d4` on `main` `e18b59a5`, same patch (`git range-diff`): the two commits are unchanged. The old base was why `test_ctest_registration.py` failed in this pull request's CI (`vk_host_region_import_test.cpp:341`); it passes on the new base. The mixed-separator case reported by DeadlyChirp is still fixed by the second commit (`f36f661e`, now `db3f77d4`). Windows 11, Python 3.12.4: `test_progress_dashboard.py` 52, `test_ctest_registration.py` 5, `test_ci_registration.py` 16 and `test_docs_links.py` 16 pass, `test_docs_cli_flags.py` and `test_text_write_line_endings.py` too. Not from this change: `test_tool_stdout_encoding.py`, `test_bink_names.py`, `test_opus_tags.py` and `test_world_names.py` fail on `main` alone as well, and the two `cs_dpp_cmp.asm` cases of the old CI run are unchanged on `main` (not run here: no `llvm-mc`). AI-assisted: yes (Claude Code)
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/1274/head:github-bot/gh-1274'
git switch 'github-bot/gh-1274'

Merge

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