Repository navigation
test_run_wine_tests: quote the interpreter passed as --wine so a path with spaces stays one argument - #4562
test_run_wine_tests: quote the interpreter passed as --wine so a path with spaces stays one argument#4562Halfect wants to merge 1 commit into
Conversation
|
Tested
AI-assisted (Devin). |
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 49449b05 on Windows 11: python -I tests/test_run_wine_tests.py -> 51 tests, OK (5 skipped); git diff --check clean.
The --wine interpreter is quoted so a path with spaces stays a single argument, and the added cases cover it. No blocking issue.
|
@Atomic258 thanks for testing! One clarification: this PR touches only |
|
Correction to my earlier comment: this PR touches only |
whattheflop
left a comment
There was a problem hiding this comment.
AI-assisted Windows x64 verification at 49449b05, uv CPython 3.12.13, with a real disposable interpreter path. With an ordinary spaced path, Windows could still launch the child after shlex.split() split the unquoted interpreter. In a path with two adjacent spaces, unquoted launch failed whereas python_wine() kept the exact path as one argument and the child launched with the same interpreter and version.
On that two-space path, base d0835dd9 had 43 passes, 5 skips and 2 failures. #4562 had 46 passes and 5 skips. The clean scratch integration with #4558 e7ac88ea had 48 passes and 5 skips. Both added scheduler tests already call the quoted helper through run_main(). The integration used a Python stand-in for Wine.
|
SOUND (test-only). The premise checks out: One weakness: the negative control cannot fail here because Approve with that. AI-assisted review, no game files, no GPU. |
|
@tupacfan04 good point — done in |
|
Tested 1b79ac9 merged with main d0835dd on WSL2 Ubuntu, Python 3.12.16: pass.
Windows 11 (Python 3.13.1, PowerShell 5.1): 52 tests OK (5 skipped). I did not check which tests are among the 5 skips. |
|
Overlap check for the queue: #4558 also edits |
|
Merged cleanly into main 3faac55; the suite passes 54/54 under python -I (re-run). The quoted --wine form matches wine_command's shlex.split on main, and the synthetic spaced-path case pins the quoting contract even where the local interpreter path has no spaces. Shares tests/test_run_wine_tests.py with #4558, which my independent check found superseded by main's ba02066 — the two merge cleanly and yours stands alone if that one closes. No CI checks reported. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
Keep the interpreter as one argument through shlex.split and pin both the quoted and unquoted behavior with a synthetic spaced path.
1b79ac9 to
88791f2
Compare
|
Rebased onto current Validation on Windows, CPU only, no game data:
The short-path temporary-directory form also fails the new upstream relative-root test on unmodified AI-assisted: Kimi Work |
|
Tested |
|
Tested 88791f2 on macOS / CPython 3.14.7: pass — |
|
Code read (CPU) — Linux, Python 3.10, no Wine, no game files.
One finding: the helper's quoting is not guarded on a machine whose interpreter path has no space. I removed the quotes from A one-line direct assertion closes that without depending on the machine: def test_python_wine_quotes_the_interpreter(self):
self.assertEqual(python_wine(), f'"{sys.executable.replace(os.sep, "/")}"')That fails on every platform if the quotes are dropped, and the synthetic case stays as the explanation of why it matters. Verdict: correct change, passes here; one suggested assertion so the fix stays pinned everywhere. AI-assisted. |
|
Reviewed 88791f2 (code read + tests on Linux, Python 3.13, no GPU): pass with remarks.
AI-assisted review: Claude ran the tests in a Linux sandbox and wrote this; I am relaying it. |
Claim: #4421 (comment)
What: The four
main()call sites intests/test_run_wine_tests.pypass the Python interpreter to--wineas an unquotedsys.executable.replace(os.sep, "/"). The runner'swine_commandsplits the value withshlex.split, which is correct command-line behaviour, so an interpreter path that contains a space —C:\Program Files\Python314on Windows, or any venv/CI path with a space, which includes this test machine's.../Application Support/...— is cut at the first space and the subprocess cannot start. Quoting the path keeps it one argument through the split. Same class of bug as #379 (which fixedmake_game.tool_available); this one is in the test's own command-line construction — the runner itself is fine.Tested: macOS 15.6.1 (Apple silicon), CPython 3.14, interpreter path containing spaces. CPU only, no game files. AI-assisted.
python -I tests/test_run_wine_tests.py→ 3 failures (test_main_maps_the_drive_while_the_tests_run,test_a_required_test_that_passes_exits_zero,test_the_summary_table_is_appended), eachcould not start /Users/<local-user>/Library/Application: No such file or directory— the path truncated at the space.wine_command(python_wine())round-trips to exactly one argument. On a machine without spaces the quotes are stripped byshlex.splitand behaviour is unchanged.No overlap with #4462 (different file,
scripts/run_wine_tests.py).