Skip to content
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

MAINT: Add stacklevel=2 to deprecation warnings #889

Merged
merged 2 commits into from
May 22, 2022
Merged

Conversation

MartinThoma
Copy link
Member

STY: Adjust code/docs in several places

@codecov
Copy link

codecov bot commented May 22, 2022

Codecov Report

Merging #889 (02b310c) into main (ce1cb66) will increase coverage by 0.03%.
The diff coverage is 77.94%.

@@            Coverage Diff             @@
##             main     #889      +/-   ##
==========================================
+ Coverage   77.18%   77.21%   +0.03%     
==========================================
  Files          17       17              
  Lines        4335     4328       -7     
  Branches      820      820              
==========================================
- Hits         3346     3342       -4     
+ Misses        814      811       -3     
  Partials      175      175              
Impacted Files Coverage Δ
PyPDF2/_utils.py 89.94% <ø> (+0.81%) ⬆️
PyPDF2/filters.py 77.14% <ø> (ø)
PyPDF2/generic.py 79.37% <ø> (+0.05%) ⬆️
PyPDF2/_reader.py 76.78% <55.55%> (+0.08%) ⬆️
PyPDF2/_page.py 73.22% <76.47%> (ø)
PyPDF2/_writer.py 79.93% <77.77%> (ø)
PyPDF2/merger.py 64.13% <80.00%> (-0.20%) ⬇️
PyPDF2/_security.py 97.18% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce1cb66...02b310c. Read the comment docs.

@MartinThoma MartinThoma merged commit f74d733 into main May 22, 2022
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
@MartinThoma MartinThoma deleted the stacklevel branch May 26, 2022 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant