-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Incorrectly show deprecation warnings on internal usage #887
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.
|
@@ -162,13 +174,8 @@ def readUntilRegex(stream, regex, ignore_eof=False): | |||
return name | |||
|
|||
|
|||
class ConvertFunctionsToVirtualList(object): | |||
class _VirtualList(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the name you used in 2.0.0-dev
branch for this to hopefully make the merge commit a bit easier.
@@ -66,23 +66,35 @@ | |||
DEPR_MSG = "{} is deprecated and will be removed in PyPDF2 2.0.0. Use {} instead." | |||
|
|||
|
|||
def _isString(s): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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
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
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).