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 #1140

Merged
merged 1 commit into from
Jul 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions PyPDF2/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,9 +1163,25 @@ def get_data(self):
self.decoded_self = decoded
return decoded._data

def getData(self):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other deprecated functions in this file do not have the # pragma: no cover so I opted to not include it here like I did in #1139 (where all deprecated functions do have the pragma). Wasn't sure if should include it (and so that would probably get codecov to pass) or not include it.

warnings.warn(
DEPR_MSG.format("getData", "get_data"),
PendingDeprecationWarning,
stacklevel=2,
)
return self.get_data()

def set_data(self, data):
raise PdfReadError("Creating EncodedStreamObject is not currently supported")

def setData(self, data):
warnings.warn(
DEPR_MSG.format("setData", "set_data"),
PendingDeprecationWarning,
stacklevel=2,
)
return self.set_data(data)


class ContentStream(DecodedStreamObject):
def __init__(self, stream, pdf):
Expand Down