Skip to content

fix(email): skip non-string body parts and display names - #4259

Closed
MohammadHijjawi97 wants to merge 1 commit into
docling-project:mainfrom
MohammadHijjawi97:fix/email-non-string-parts
Closed

MohammadHijjawi97 wants to merge 1 commit into
docling-project:mainfrom
MohammadHijjawi97:fix/email-non-string-parts

Conversation

@MohammadHijjawi97

Copy link
Copy Markdown
Contributor

Summary

mailparser can return None for a missing display name or a body part. _header_safe and _split_paragraphs called str.split on that value, which raised AttributeError and aborted conversion. Skip non-string names and body parts instead.

Test plan

  • pytest tests/test_backend_email.py::test_header_safe_skips_non_string_values tests/test_backend_email.py::test_split_paragraphs_skips_non_string_bodies

mailparser can return None for a missing display name or a body part.
Calling str.split on that raised AttributeError and aborted conversion.

Signed-off-by: Mohammad Hijjawi <mohammad.hijjawi1997@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

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

@mergify

mergify Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 Enforce conventional commit

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)(?:\(.+\))?(!)?:

@dolfim-ibm

Copy link
Copy Markdown
Member

Thanks for the contributions, @MohammadHijjawi97.

This is one of 15 PRs opened on the same day from what looks like an automated sweep for possible crashes across the backends. We cannot review that many individually, so we are handling them as a group:

About this PR: The guard protects against value types we have no evidence the upstream parser produces, and the test calls a private helper with hand-made values.

Unless a reproducing input file is provided, we intend to close this one.

@MohammadHijjawi97

Copy link
Copy Markdown
Contributor Author

Closing this per the review on the grouped PRs. Happy to reopen if we have an input file that reproduces the crash through DocumentConverter.convert(), ideally with a linked issue.

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