Skip to content

Commit 27f503c

Browse files
Update pdfminer_utils.py (#3974)
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`)
1 parent d570f46 commit 27f503c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This makes it impossible to write stable unit tests, for example, or to obtain r
1919

2020
### Fixes
2121
- **Removed out of date ubuntu Dockerfile.** The Dockerfile was out of date and non-functional.
22+
- **Fix for 'PSSyntaxError' import error: "cannot import name 'PSSyntaxError' from 'pdfminer.pdfparser'"** PSSyntaxError needed to be imported from its source 'pdfminer.psexceptions'.
2223

2324
## 0.17.4
2425

Diff for: unstructured/partition/pdf_image/pdfminer_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pdfminer.layout import LAParams, LTContainer, LTImage, LTItem, LTTextLine
77
from pdfminer.pdfinterp import PDFPageInterpreter, PDFResourceManager
88
from pdfminer.pdfpage import PDFPage
9-
from pdfminer.psparser import PSSyntaxError
9+
from pdfminer.psexceptions import PSSyntaxError
1010
from pydantic import BaseModel
1111

1212
from unstructured.logger import logger

0 commit comments

Comments
 (0)