Repository navigation
tools: read UTF-16 package files in the offline matcher - #3629
Open
cixiangtao wants to merge 1 commit into
Open
cixiangtao wants to merge 1 commit into
cixiangtao wants to merge 1 commit into
Conversation
|
maintainer-bot review · this one needs a maintainer decision Thanks for the PR! Couldn't review this one automatically; it goes to the maintainer. Checks
Reviewed by maintainer-bot · runs on 0G Private Computer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
match.pyread saved package files only as UTF-8, so the documentedpm list packages > packages.txtworkflow in Windows PowerShell 5.1 produced exit 2 with "no package names". Detect a UTF-16 BOM before decoding, retaining the existing UTF-8/BOM behavior for other files, and document the accepted package-file formats.Tested on: macOS, Python 3.13.9 and 3.14.6, with generated encoding fixtures and isolated CLI subprocesses. No native Windows PowerShell 5.1 or TV run is claimed.
Microsoft's encoding documentation confirms that Windows PowerShell redirection defaults to UTF-16LE and writes a BOM. The regression covers UTF-16LE/BE, UTF-8 with/without BOM, CRLF, bare names,
pm -flines and duplicate names. CLI output has identical counts andnevermarkers across the formats, and input files remain byte-for-byte intact.Validation:
294d3d59; the UTF-8 controls passed.tools/venv/bin/python -m unittest tests.test_match -v: 37 tests passed on Python 3.13.9.python3 -m unittest tests.test_match -v: 37 tests passed on Python 3.14.6.CLEANYOURTV_STRICT=1 tools/venv/bin/python -m unittest discover -s tests -v: 3211 tests, 30 skipped, one failure intest_relay.RelayTest.test_listens_on_loopback_only(expected the LAN connection to raise OSError, but it connected). The exact method was rerun this round on a clean worktree of unmodified base294d3d59, and failed with the same assertion. No relay code or checks were changed.git diff --checkpassed.TV-list, launcher, theme and add-on checklist sections are not applicable to this offline host-tool fix. Prepared with OpenAI Codex; the checks above were run locally.