mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:10:53 +01:00
[PR #2273] inline_scan: support UTF-8 BOM, clean up dumpbin Popen on early close, and validate --base #2277
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2277
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2273
Author: @kirigayakazima
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/inline-scan-safety📝 Commits (1)
757ffc3inline_scan: support UTF-8 BOM, clean up dumpbin Popen on early close, and validate --base📊 Changes
2 files changed (+111 additions, -8 deletions)
View changed files
📝
tests/test_inline_scan.py(+79 -0)📝
tools/inline_scan.py(+32 -8)📄 Description
Claimed in the coordination issue as: INLINE-SCAN-BOM-DUMPBIN-CLEANUP-AND-CLI-SAFETY (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7191397017)
What and why
tools/inline_scan.pypreviously:"utf-8"instead of"utf-8-sig", causing line 1 to missLINEmatching when a file started with a UTF-8 BOM.dumpbinviasubprocess.Popenwithoutencoding="utf-8"ortry/finallycleanup, risking locale-dependent decoding and leaking/leavingdumpbinrunning if iteration stopped early.main()with noargvparameter, accepted negative--basevalues (like-0x1000), and letOSErrorfrom reading listings crash unhandled instead of exiting 2.This uses
"utf-8-sig"for listings, addsencoding="utf-8"andtry/finallypipe/process cleanup inread_lines(), adds_parse_baserejecting negative hex bases, acceptsargv=Noneinmain(), handlesOSErrorcleanly, and adds unit/CLI tests intests/test_inline_scan.py.Tested
python -I tests/test_inline_scan.py -v(17 passed)upstream/mainbaseline negative control: failed with the new tests before the fixpython -I tests/test_ci_registration.py,python -I tests/test_text_write_line_endings.py,python -I scripts/check_no_game_data.py,python -I -m compileall -q, andgit diff --cached --checkGPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.