BUG: Wrong page inserted when PdfMerger.merge is done#1063
Merged
MartinThoma merged 3 commits intomainfrom Jul 5, 2022
Merged
Conversation
Caused-by: #207 Why it wasn't detected by the tests: We don't have any tests that check for the correct result of a merge. We just check for exceptions How we prevent it in future: Unit test was added Risk of the fix: - We will have bigger file sizes again as #207 was effectively reverted - We will need to adjust this test if we change the way we write PDFs Closes: #1062
Codecov Report
@@ Coverage Diff @@
## main #1063 +/- ##
==========================================
- Coverage 90.89% 90.86% -0.04%
==========================================
Files 24 24
Lines 4515 4508 -7
Branches 923 920 -3
==========================================
- Hits 4104 4096 -8
- Misses 268 271 +3
+ Partials 143 141 -2
Continue to review full report at Codecov.
|
MartinThoma
added a commit
that referenced
this pull request
Jul 5, 2022
New Features (ENH): - Add PdfReader.xfa attribute (#1026) Bug Fixes (BUG): - Wrong page inserted when PdfMerger.merge is done (#1063) - Resolve IndirectObject when it refers to a free entry (#1054) Developer Experience (DEV): - Added {posargs} to tox.ini (#1055) Maintenance (MAINT): - Remove PyPDF2._utils.bytes_type (#1053) Testing (TST): - Scale page (indirect rect object) (#1057) - Simplify pathlib PdfReader test (#1056) - IndexError of VirtualList (#1052) - Invalid XML in xmp information (#1051) - No pycryptodome (#1050) - Increase test coverage (#1045) Code Style (STY): - DOC of compress_content_streams (#1061) - Minimize diff for #879 (#1049) Full Changelog: 2.4.1...2.4.2
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.
Caused-by: #207
Why it wasn't detected by the tests: We don't have any tests that check
for the correct result of a merge. We just check for exceptions
How we prevent it in future: Unit test was added
Risk of the fix:
Closes: #1062