Repository navigation
ROB: Do not crash on merging pages whose resources are not a dictionary - #4350
Merged
stefan6419846 merged 3 commits intoNov 10, 2026
Merged
stefan6419846 merged 3 commits into
stefan6419846 merged 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4350 +/- ##
=======================================
Coverage 98.80% 98.80%
=======================================
Files 59 59
Lines 12183 12184 +1
Branches 2316 2316
=======================================
+ Hits 12037 12038 +1
Misses 71 71
Partials 75 75 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
stefan6419846
requested changes
Nov 7, 2026
Contributor
Author
|
Good point: "own" was meant as "not inherited from the parent pages", which is what merge_page has always used. I removed the second helper; merge_page now calls _get_page_resources(page, inherit=False), so the name states the difference. Also applied your docstring suggestion. |
stefan6419846
approved these changes
Nov 10, 2026
stefan6419846
approved these changes
Nov 10, 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.
page.merge_page(page2)raisedTypeError: argument of type 'NumberObject' is not iterablewhen the/Resourcesof either page is a number, array, string or null, for example a page read from a malformed file.The malformed resources are now treated as empty, like #4272 and #4329 do: "Page resources are not a dictionary: ..." is logged (no warning for null), and the resources of the other page are still merged. When the page that receives the merge has malformed resources, they are replaced by a new dictionary.
Added
test_merge_page__resources_are_not_a_dictionary, covering both pages and a page read back withPdfReader; it fails on main