Repository navigation
BUG: Report an out-of-range page number when adding a destination or URI - #4016
Merged
stefan6419846 merged 2 commits intoAug 27, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4016 +/- ##
=======================================
Coverage 98.00% 98.00%
=======================================
Files 57 57
Lines 11136 11143 +7
Branches 2090 2091 +1
=======================================
+ Hits 10914 10921 +7
Misses 124 124
Partials 98 98 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RavSinghChandan
force-pushed
the
page-number-out-of-range
branch
2 times, most recently
from
August 26, 2026 11:54
75730ad to
b7e07da
Compare
stefan6419846
requested changes
Aug 26, 2026
add_named_destination and add_uri index the kids array with the page number directly, so a number past the end surfaced as 'IndexError: list index out of range' with nothing pointing at the argument that caused it. _VirtualList already raises IndexError with the index it was given, so both now report the page number and keep accepting negative ones.
The bounds check computed it twice, which is wasteful for a document with many pages.
RavSinghChandan
force-pushed
the
page-number-out-of-range
branch
from
August 27, 2026 02:38
b7e07da to
eefb423
Compare
Contributor
Author
|
Good point, the length is taken once now. |
stefan6419846
approved these changes
Aug 27, 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.
add_named_destinationandadd_uriindex the kids array with the page number directly:Nothing in the message points at the argument that caused it.
_VirtualListalready raisesIndexErrorwith the index it was given, so both now report the page number through a shared lookup and keep accepting negative ones.Reverting the change fails the eight new tests