Skip to content

Conversation

@jeremythuon
Copy link

When we set a parameter that is not a string, Path or BytesIO in load(). We get an error like this:

File “/data/zeromq/lib64/python3.9/site-packages/docling_parse/pdf_parser.py”, line 624, in load
if success:
UnboundLocalError: local variable ‘success’ referenced before assignment

With my fix:

File "/data/zeromq/lib64/python3.9/site-packages/docling_parse/pdf_parser.py", line 639, in load
raise RuntimeError(f"Receive path_or_stream type: {type(path_or_stream)}, only support string, Path or BytesIO")
RuntimeError: Receive path_or_stream type: <class 'bytes'>, only support string, Path or BytesIO

Signed-off-by: jeremy-thuon <18218996+jeremythuon@users.noreply.github.com>
@github-actions
Copy link
Contributor

DCO Check Passed

Thanks @jeremythuon, all your commits are properly signed off. 🎉

@mergify
Copy link

mergify bot commented Sep 29, 2025

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@jeremythuon jeremythuon changed the title Fix unknown type problem loading PDF fix: unknown type problem loading PDF Sep 29, 2025
Copy link
Contributor

@PeterStaar-IBM PeterStaar-IBM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants