Skip to content

fix(datamodel): let the extension pick between OLE2 legacy Office formats - #4476

Merged
PeterStaar-IBM merged 1 commit into
docling-project:mainfrom
drakeo338:claude/4474-fix
Oct 4, 2026
Merged

PeterStaar-IBM merged 1 commit into
docling-project:mainfrom
drakeo338:claude/4474-fix

Conversation

@drakeo338

Copy link
Copy Markdown
Contributor

Resolves #4474

A Word .doc whose first OLE2 sector is a FAT sector is detected by filetype as Excel or PowerPoint, so it was sent to the wrong backend and failed. When the detected type is one of the OLE2-based legacy formats (doc, ppt, xls), the format is now resolved from the file extension instead. A file with a misleading extension is still misrouted, which is the same trade-off the extension fallback already makes elsewhere.

Checklist:

  • Documentation has been updated, if necessary. (not needed, no user-facing change)
  • Examples have been added, if necessary. (not needed)
  • Tests have been added, if necessary. (tests/test_input_doc.py: 13 passed on the committed HEAD; 3 of the new ones fail without the fix)

make validate was not run.

…mats

filetype reports an OLE2 file whose first sector is a FAT sector as Excel
or PowerPoint, so a Word .doc was routed to the wrong backend. When the
detected type is one of the OLE2 based formats (doc, ppt, xls), resolve it
from the file extension instead.

Resolves docling-project#4474

Signed-off-by: drakeo338 <paranoyouz@gmail.com>
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

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

@mergify

mergify Bot commented Oct 1, 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)(?:\(.+\))?(!)?:

@codecov

codecov Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@PeterStaar-IBM PeterStaar-IBM left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm!

@PeterStaar-IBM
PeterStaar-IBM merged commit 58f1f8d into docling-project:main Oct 4, 2026
26 checks passed
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.

Legacy OLE2 .doc detected as XLS by filetype; no way to override the input format

2 participants