fix: skip invalid local sources in DoclingServeConverter#3449
Merged
Conversation
A missing or unreadable local file made Path(source).read_bytes() raise FileNotFoundError (an OSError), which propagated out of run()/run_async() and aborted conversion of all remaining sources. Catch OSError and TypeError during source preparation, log a warning, and continue with the rest. Ports the fix from #3150 onto the current merged integration. Co-authored-by: turkesh <48882105+turkeshp@users.noreply.github.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Coverage report (docling_serve)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
julian-risch
marked this pull request as draft
June 16, 2026 07:24
julian-risch
marked this pull request as ready for review
June 16, 2026 07:44
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
Proposed Changes
Makes invalid local sources non-fatal in
DoclingServeConverter.run()andrun_async().A missing or unreadable local file caused
Path(source).read_bytes()to raiseFileNotFoundError(anOSError), which propagated out of the conversion loop and aborted conversion of all remaining sources, discarding any already-converted documents. The loop already handledhttpxerrors and DoclingServe conversion/timeout errors, but not local-file read failures.This adds an
except (OSError, TypeError)handler to bothrun()andrun_async()that logs a warning and skips the offending source, continuing with the rest. That is consistent with how the component already treats other per-source failures.How did you test it?
I ran docling-serve with docker locally and tested the new functionality successfully
Notes for the Reviewer
Checklist
🤖 Generated with Claude Code