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

BUG: Add missing deprecated EncodedStreamObject functions #1139

Merged
merged 1 commit into from Jul 21, 2022

Conversation

MasterOdin
Copy link
Member

@MasterOdin MasterOdin commented Jul 20, 2022

Closes #1138

The EncodedStreamObject class was missing the deprecated getData and setData functions, which would call the get_data and set_data functions respectively after issuing a deprecation warning. The original functions were totally renamed in c774ab0. That same commit did properly handle the getData and setData functions in the DecodedStreamObject though, where they issue a deprecation warning and then call get_data and set_data.

This should probably be backported to 1.x where it exists as well, as it should be simple enough, and the user in #1138 is using 1.28.2 and cannot upgrade due to this bug.

@codecov
Copy link

codecov bot commented Jul 20, 2022

Codecov Report

Merging #1139 (4a1304f) into main (fd00f20) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1139   +/-   ##
=======================================
  Coverage   91.94%   91.94%           
=======================================
  Files          24       24           
  Lines        4681     4681           
  Branches      967      967           
=======================================
  Hits         4304     4304           
  Misses        231      231           
  Partials      146      146           
Impacted Files Coverage Δ
PyPDF2/generic.py 91.72% <ø> (ø)

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 fd00f20...4a1304f. Read the comment docs.

@MartinThoma MartinThoma merged commit e1f9772 into main Jul 21, 2022
@MartinThoma MartinThoma deleted the bug-missing-dep-functions branch July 21, 2022 16:12
@MartinThoma
Copy link
Member

Thank you 🤗 I will make a release today with the fix for the current main branch.

I'm uncertain if I really want to do backports. For which versions would I need to do them? For which kinds of bugs would we make it? How long would we need to support old versions?

MartinThoma pushed a commit that referenced this pull request Jul 21, 2022
@MasterOdin
Copy link
Member Author

I think the only thing that should be backported is just these sorts of PRs, where functions were unintentionally broken by a rename or whatever, and that the fix is super straightforward. Given the probably very long tail of 1.x usage that exists and time between major releases, I would say support backporting for like 6 months or so, but I don't imagine there should be that many of these sorts of reports.

Any other changes or features I think should not be backported.

@MartinThoma
Copy link
Member

Sounds good and also a reasonable workload. Let's do that :-) Thank you :-)

MartinThoma added a commit that referenced this pull request Jul 21, 2022
New Features (ENH):
-  Add `outline_count` property (#1129)

Bug Fixes (BUG):
-  Make reader.get_fields also return dropdowns with options (#1114)
-  Add deprecated EncodedStreamObject functions back until PyPDF2==3.0.0 (#1139)

Robustness (ROB):
-  Cope with missing /W entry (#1136)
-  Cope with invalid parent xref (#1133)

Documentation (DOC):
-  Contributors file (#1132)
-  Fix type in signature of PdfWriter.add_uri (#1131)

Developer Experience (DEV):
-  Add .git-blame-ignore-revs (#1141)

Code Style (STY):
-  Fixing typos (#1137)
-  Re-use code via get_outlines_property in tests (#1130)

Full Changelog: 2.6.0...2.7.0
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.

AttributeError: 'EncodedStreamObject' object has no attribute 'getData'
2 participants