-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #320 from jsvine/issue-316
Code and commits by @samkit-jain: * Treat invalid/unparseable metadata values as warnings — Certain invalid values if parseable don't throw a warning and only unparseable (always invalid) throw * Recursively parse metadata values to handle nested `PDFObjRef` objects — Fixes #316 * Resolve lint issues and remove unused imports * Make metadata parse failure handling behaviour configurable * Update tests to bump up test coverage * Update changelog Co-authored-by: Samkit Jain <15127115+samkit-jain@users.noreply.github.com>
- Loading branch information
Showing
8 changed files
with
66 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
pytest | ||
pytest-cov | ||
pytest-parallel | ||
pytest==6.1.2 | ||
pytest-cov==2.10.1 | ||
pytest-parallel==0.1.0 | ||
flake8==3.8.3 | ||
black==20.8b0 |
Binary file not shown.
This file contains 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
This file contains 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
f2c510d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsvine @samkit-jain tell me how you resolved the issue, just as a curiosity!
f2c510d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Abdur-rahmaanJ I'll focus on the core issue that affected the PDF you shared. Prior to this change,
pdfplumber
expected a metadata value of type list to contain only strings. In the PDF you shared, that wasn't the case. There was a list, not of strings, but of metadata objects itself. Think of it like this, say, a metadata object looks likeIn your case, the object came out to be
That is, instead of being
it was
So, I made the resolver method recursive to account for such cases. The method would continue resolving
M
s at all nested levels until all are resolved.Was I able to satisfy your curiosity?
f2c510d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samkit-jain so it was not in the PDF specs ^^, thank you very much for this answer!