fix: is_markitdown_format crashes on a non-string path (#1618)

This commit is contained in:
Afonso Coutinho
2026-06-03 01:00:10 +01:00
committed by GitHub
parent fc220f760f
commit aa5e3f6884
2 changed files with 18 additions and 0 deletions

View File

@@ -26,6 +26,8 @@ MARKITDOWN_EXTS = frozenset({".docx", ".pptx", ".xlsx", ".xls", ".epub"})
def is_markitdown_format(path: str) -> bool:
"""True if the file extension is one we route through markitdown."""
if not isinstance(path, str):
return False
return os.path.splitext(path)[1].lower() in MARKITDOWN_EXTS