BUG: Incorrectly show deprecation warnings on internal usage#887
Merged
MartinThoma merged 2 commits intomainfrom May 22, 2022
Merged
BUG: Incorrectly show deprecation warnings on internal usage#887MartinThoma merged 2 commits intomainfrom
MartinThoma merged 2 commits intomainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #887 +/- ##
==========================================
- Coverage 77.25% 77.18% -0.07%
==========================================
Files 17 17
Lines 4326 4335 +9
Branches 819 820 +1
==========================================
+ Hits 3342 3346 +4
- Misses 809 814 +5
Partials 175 175
Continue to review full report at Codecov.
|
MasterOdin
commented
May 22, 2022
|
|
||
|
|
||
| class ConvertFunctionsToVirtualList(object): | ||
| class _VirtualList(object): |
Member
Author
There was a problem hiding this comment.
Using the name you used in 2.0.0-dev branch for this to hopefully make the merge commit a bit easier.
| DEPR_MSG = "{} is deprecated and will be removed in PyPDF2 2.0.0. Use {} instead." | ||
|
|
||
|
|
||
| def _isString(s): |
Member
Author
There was a problem hiding this comment.
Decided to go with the camel case for these functions to make the diff a bit easier to read imo, and since these functions are not user facing and are going to be removed anyway in 2.0.0, it does not matter much on their naming convention imo.
MartinThoma
added a commit
that referenced
this pull request
May 22, 2022
Bug Fixes (BUG): - Incorrectly show deprecation warnings on internal usage (#887) Maintenance (MAINT): - Add stacklevel=2 to deprecation warnings (#889) - Remove duplicate warnings imports (#888) Full Changelog: 1.28.0...1.28.1
MartinThoma
pushed a commit
that referenced
this pull request
May 23, 2022
Fixes a deprecation warning being raised when trying to use the PdfMerger class. This regression of #887 is caused by #889 which reversed the changes done to the PyPDF2/merger.py module so that it once again used the deprecated user-facing isString method as opposed to the internal _isString method. Additionally, this PR fixes the deprecation warning raised by referencing reader.namedDestinations as opposed to reader.named_destinations. Closes #890
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 #886
PR fixes a bug where the codebase was internally relying on deprecated functions and so would trigger the warnings even though there's no action the user could meaningful taken. Now, the internal usage relies on an internal version of the function that executes as before sans deprecation warning while leaving in place a user facing version of the function that has the deprecation warning (and relies on the new internal function to keep behavior consistent).