test(crash): test_crash_dialog passes its quoting case's argument as hex and writes its records with LF, so it runs on Windows #1012
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1012
Loading…
Reference in a new issue
No description provided.
Delete branch "d4nkn3ss/Longshot:test/crash-dialog-utf8-arg"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: test · Risk: low · Tested on: Windows 11, RTX 3080 · Needs: none
Why
test_crash_dialogfails on Windows on main, and Windows is where the crash window runs most. It checks the window shown after a crash: its verdicts and causes, the report's redaction and the issue link. Two things stop it there, both in how the check talks to its fixture, not in the game:ゲーム Zélda 🎮as a command-line argument. Windows hands a narrowargvover in the ANSI code page, so the fixture prints é as byte 0xe9, and reading its output as UTF-8 fails (UnicodeDecodeError ... 0xe9).record()writes its crash records with Python's text mode, CR LF on Windows. The dialog's reader doesn't take such a file for a record, so every verdict comes back quiet. The game writes its records withWriteFile, LF, and reads them inrb.#626 made the check run through on Linux. I searched the open PRs for its name and found none that changes it for Windows.
What changed
The quoting case sends its argument as hex, which the fixture decodes, so the bytes arrive exactly on every OS.
record()writes LF. Log files stay as they were: I ran the reader on CR LF logs, with LF records, and it passed every case. What the check asserts is unchanged.tests/test_crash_dialog.py:quotecommand decodesargv[3]from hex;quotecalls send the argument's UTF-8 bytes as hex;record()writes LF line ends.Measurements
Verdict: nothing to measure: a check only. It fails on Windows main and passes here.
Flags and settings
None
Testing
Tested:
python -I -B tests/run_all.pyfrom PowerShell on Windows 11, with llvm-mingw from the Longshot Builder.1764fed2cbe1f49ctest_crash_dialogUnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9, then with that fixedverdict(crash, plain)= (0, 0, 0)run_all.pyin allThe 18 left fail on main too:
test_auto_handheld,test_bug_report_defaults,test_crt_options,test_fsr_uniform_ownership,test_guest_imported,test_import_reach,test_linux_preflight,test_make_game_cache,test_missing_nup,test_pads_after_menu,test_parallel_init_order,test_pending_guest_import,test_release,test_replay_write_order,test_run_all_changed,test_tested_configurations,test_vk_occlusion_queries,test_walk_key. Some have open PRs: #1011, #1009, #1007, #1006, #1003, #993, #999, #592, #144, #954, #937 and #537.Not tested: Linux and macOS, where argv and files were already UTF-8 and LF. The hex round trip is plain C.
Must be tested: None. The change is to a check only.
Risks
What could break: nothing in the game: only
tests/changes.Turning it off: revert the commit.
Compatibility: Nothing changes.
Issues
See #593, #626
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
WIP: test(crash): test_crash_dialog passes its quoting case's argument as hex and writes its records with LF, so it runs on Windowsto test(crash): test_crash_dialog passes its quoting case's argument as hex and writes its records with LF, so it runs on Windows#1056 builds on this branch: it gives the crash window the right verdict for six out-of-memory crash reports, and its new cases need this PR to run on Windows. So this one first, please.
Posted by an AI agent (Claude Code) for d4nkn3ss.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.