docling-project / docling-project/docling-parse
DoclingPdfParser fails to load resources if user path contains special characters (e.g. á) on Windows
- Dominant language
- C++
- Stars
- 333
- Forks
- 80
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 10
Description
Hi team — thanks for the excellent work on docling-parse. I’ve been integrating it into a structured pipeline that extracts text from PDFs, but ran into an issue on Windows when the user directory contains special characters (like á in C:\Users\Tomás).
When calling:
```
from docling_parse.pdf_parser import DoclingPdfParser
parser = DoclingPdfParser()
```
I get:
RuntimeError: no existing pdf_resources_dir: c:\Users\Tomás Mello\...
This appears to be an encoding issue — the path is being misinterpreted as Latin-1/ANSI instead of UTF-8.
A few notes:
The pdf_resources_v2/ folder exists, but Docling fails to find it because of the mangled path.
The fallback error message says: "Input document ... is not valid", which is misleading — the real issue is initialization failure.
I fixed it locally by manually setting os.environ["DOC_PARSER_PDF_RESOURCES_DIR"] to a UTF-8-clean path (e.g. under C:\AI\docling_pdf_resources), but this isn't portable or CI/CD friendly.
Suggested fix:
Normalize the path internally using Path(...).resolve() or equivalent with encoding='utf-8'
Consider falling back to sys.getfilesystemencoding() if applicable
Allow overriding the resources folder in a more documented/official way
Would love to know if this is something you'd be open to fixing. Happy to test any proposed patch or submit a small PR.
Thanks again!
Contributor guide
Assessment
This issue has not been assessed yet.