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

Did the type of exception raised due to failed calls to .save() based on character out of range change between 5.01 and 5.15? #372

Closed
metaperl opened this issue Jul 26, 2022 · 2 comments

Comments

@metaperl
Copy link

related issues

Issue for this ticket

our software attempts to save a .pdf document via a call to .save() with arguments stream_decode_level=StreamDecodeLevel.none, compress_streams=True

When this has failed, a RuntimeError is trapped and the save is attempted with compress_streams=False

However, recently RuntimeError is no longer the exception thrown when the compressed save fails and the only solution I had (under pressure) was to catch Exception instead of a more specific exception.

Question

Did the type of exception raised on a save that failed for this reason change sometime between release 5.0.1 and 5.15?

@jbarlow83
Copy link
Member

Commit 0bd6795, introduced for v3.0.0, traps some instances of RuntimeError (raised by qpdf) and replaces them with pikepdf.DataDecodingError.

The behavior change you observed, I suspect is due to a change in the libqpdf version, but without a test file and example, that is just a guess.

@metaperl
Copy link
Author

without a test file and example, that is just a guess.

Yes, I work with proprietary data and cannot share the document that produced the error. But I agree with your guess.

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

No branches or pull requests

2 participants