ROB: Silently ignore Adobe Ascii85 whitespace#3528
Merged
stefan6419846 merged 6 commits intopy-pdf:mainfrom Nov 21, 2025
Merged
ROB: Silently ignore Adobe Ascii85 whitespace#3528stefan6419846 merged 6 commits intopy-pdf:mainfrom
stefan6419846 merged 6 commits intopy-pdf:mainfrom
Conversation
added 2 commits
November 20, 2025 00:19
Based on the PDF standards "the ASCII85Decode filter shall ignore all white-space characters".
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3528 +/- ##
=======================================
Coverage 97.16% 97.16%
=======================================
Files 57 57
Lines 9807 9809 +2
Branches 1780 1781 +1
=======================================
+ Hits 9529 9531 +2
Misses 167 167
Partials 111 111 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
Please note that it might take another day to merge this as https://docs.python.org is currently offline and we rely on it for generating documentation, which would fail our CI on the merge commit otherwise. |
stefan6419846
added a commit
that referenced
this pull request
Nov 23, 2025
## What's new ### Security (SEC) - Reduce default limit for LZW decoding by @stefan6419846 ### New Features (ENH) - Parse and format comb fields in text widget annotations (#3519) by @PJBrs ### Robustness (ROB) - Silently ignore Adobe Ascii85 whitespace for suffix detection (#3528) by @mbierma [Full Changelog](6.3.0...6.4.0)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PDF standard specifies that "the ASCII85Decode filter shall ignore all white-space characters" (spaces, tabs, newlines, etc.)
While the code currently strips leading and trailing whitespace, it fails to remove whitespace characters contained within the main data stream
This issue manifests because the Python standard library a85decode is performing its end-of-data check (
~>) before honoring the ignorechars parameter for internal whitespaceThis can cause failures when decoding certain PDF files and the fix improves the robustness of #2996.
The update ensures that all whitespace characters immediately preceding the final
>are removed prior to passing the data to the a85decode decoder.