Repository navigation
ROB: Fall back to the page position when the page label /Nums is not an array - #4271
Merged
stefan6419846 merged 3 commits intoOct 29, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4271 +/- ##
=======================================
Coverage 98.54% 98.54%
=======================================
Files 59 59
Lines 11992 11995 +3
Branches 2267 2268 +1
=======================================
+ Hits 11817 11820 +3
Misses 95 95
Partials 80 80 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
stefan6419846
requested changes
Oct 29, 2026
Contributor
Author
|
No good reason. I have changed it to pass /Nums when creating the dictionary. |
stefan6419846
approved these changes
Oct 29, 2026
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.
reader.page_labelsraisedTypeError: object of type 'NumberObject' has no len()when the/Numsentry of/PageLabelsis not an array, for example<< /Nums 1 >>.index2label()already warns and falls back to the page position when/PageLabelsis not a dictionary or/Kidsis not an array, butget_label_from_nums()calledlen()on/Numswithout a check (index2labels()from #4251 already sends this case page by page toindex2label()).get_label_from_nums()now does the same for/Nums: it logs "Page label numbers are not an array: ..." and returns the page position. Addedtest_index2label__nums_not_an_arraynext totest_index2label__kids_not_an_array, with the same number, dictionary and string cases.