check: report invalid pack names instead of crashing - #10068
Merged
ThomasWaldmann merged 1 commit intoAug 9, 2026
Conversation
An object in packs/ whose name is not valid hex made check() abort via hex_to_bin; report it as an error and continue checking the other packs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10068 +/- ##
==========================================
+ Coverage 86.76% 86.77% +0.01%
==========================================
Files 98 98
Lines 17100 17109 +9
Branches 2589 2591 +2
==========================================
+ Hits 14837 14847 +10
Misses 1570 1570
+ Partials 693 692 -1 ☔ View full report in Codecov by Harness. |
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.
Fixes #10051.
check()decoded every name inpacks/withhex_to_binwithout validating it first. A stray object whose name is not 64 hex digits raised aValueErrorthat aborted the whole check with a traceback, skipping every pack after it.Now
check()drops names that are not valid pack names, logs each one as an error, and verifies the rest. The check still fails (non-zero exit), so the stray object is not silently ignored.Also adds a test: it stores one intact pack plus a stray non-hex object and checks that the error is reported and the good pack is still verified.