Update pdfminer_utils.py#3974
Conversation
Fix for 'PSSyntaxError' import error. "cannot import name 'PSSyntaxError' from 'pdfminer.pdfparser'" Latest pdfminer-six doesn't import PSSyntaxError into `pdfminer.pdfparser` anymore. It must now be directly imported from its source (`pdfminer.psexceptions`)
cragwolfe
left a comment
There was a problem hiding this comment.
Thanks for the patch. However, I think the version of pdfminer should be checked to determine whether to import the older or newer version for backwards compat.
|
This change will also work on the older version. In the older version, However they have since removed the PSSyntaxError import from Therefore, for the new pdfminer version we must change to directly import from We can do PSSyntaxError is defined in Here is the commit for the change on pdfminer. |
|
please add a bullet under Fixes in, CHANGELOG.md. thanks for the contribution @Nathan-GoSupply ! the reference to the pdfminer commit is also appreciated. |
pdfminer bug fix
Fix for 'PSSyntaxError' import error:
"cannot import name 'PSSyntaxError' from 'pdfminer.pdfparser'"
Latest pdfminer-six doesn't import PSSyntaxError into
pdfminer.pdfparseranymore. It must now be directly imported from its source (pdfminer.psexceptions)