Repository navigation
fix(email): skip non-string body parts and display names - #4259
MohammadHijjawi97 wants to merge 1 commit into
Conversation
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>
|
✅ DCO Check Passed Thanks @MohammadHijjawi97, all your commits are properly signed off. 🎉 |
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
|
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. |
|
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. |
Summary
mailparser can return
Nonefor a missing display name or a body part._header_safeand_split_paragraphscalledstr.spliton that value, which raisedAttributeErrorand 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