Skip to content

fix(xls): avoid treating doc files as workbooks - #2721

Open
与世无争剑宇子 (yushiwuzhengjianyuzi) wants to merge 1 commit into
microsoft:mainfrom
yushiwuzhengjianyuzi:fix/xls-doc-mime-misclassification
Open

与世无争剑宇子 (yushiwuzhengjianyuzi) wants to merge 1 commit into
microsoft:mainfrom
yushiwuzhengjianyuzi:fix/xls-doc-mime-misclassification

Conversation

@yushiwuzhengjianyuzi

Summary

  • Make XlsConverter prefer a known file extension over spreadsheet MIME types.
  • Prevent legacy .doc files that upstream systems mislabel as application/vnd.ms-excel from being passed to xlrd, which surfaced an XLRDError instead of a clean unsupported-format result.
  • Keep MIME detection as a fallback for extensionless streams.

Tests

  • pytest packages/markitdown/tests/test_xlsx.py packages/markitdown/tests/test_module_misc.py::test_legacy_doc_with_excel_mimetype_is_not_sent_to_xls_converter packages/markitdown/tests/test_module_misc.py::test_exceptions -q (28 passed)
  • black --check on the changed Python files

Fixes #2288

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.

MarkItDown 解析旧版 .doc 存在原生崩溃 Bug

1 participant