{"record":{"id":"3638ef374e35fd30","repo":"HKUDS/DeepTutor","slug":"markitdown-failed-to-convert-path-source-path-na","errorCode":null,"errorMessage":"markitdown failed to convert {Path(source_path).name}: {exc}","messagePattern":"markitdown failed to convert (.+?): (.+?)","errorType":"exception","errorClass":"ParserError","httpStatus":null,"severity":"error","filePath":"deeptutor/services/parsing/engines/markitdown/engine.py","lineNumber":89,"sourceCode":"        return ReadinessReport(ready=True)\n\n    def parse(\n        self,\n        source_path: Path,\n        workdir: Path,\n        *,\n        config: MarkItDownConfig,\n        on_output: Optional[Callable[[str], None]] = None,\n    ) -> None:\n        from markitdown import MarkItDown\n\n        if on_output:\n            on_output(f\"Converting {Path(source_path).name} via markitdown…\")\n        try:\n            converter = MarkItDown()\n            result = converter.convert(str(source_path))\n        except Exception as exc:  # noqa: BLE001 - surface as a parser error\n            raise ParserError(f\"markitdown failed to convert {Path(source_path).name}: {exc}\")\n\n        text = getattr(result, \"text_content\", None) or getattr(result, \"markdown\", None) or \"\"\n        stem = Path(source_path).stem\n        (workdir / f\"{stem}.md\").write_text(str(text), encoding=\"utf-8\")\n\n\n__all__ = [\"MarkItDownParser\"]\n","sourceCodeStart":71,"sourceCodeEnd":97,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/services/parsing/engines/markitdown/engine.py#L71-L97","documentation":"The MarkItDown conversion step raised an arbitrary exception, which the engine wraps as a ParserError naming the file. MarkItDown throws for unsupported extensions, unreadable/corrupt files, or missing optional converters (e.g. mammoth, pdfminer).","triggerScenarios":"converter.convert(str(source_path)) raising — unsupported file type, empty/corrupt document, or MarkItDown installed without the extras needed for that format.","commonSituations":"Feeding exotic formats (old .doc, ODF) without extras installed; corrupted Office/PDF files; MarkItDown version change altering supported formats.","solutions":["Inspect the wrapped exc to see MarkItDown's underlying message.","Confirm the file type is supported and the file is valid.","pip install -U 'markitdown[all]' to get every format converter.","Catch ParserError and fall back to another engine."],"exampleFix":"// before\nout = engine.parse(p)\n\n// after\ntry:\n    out = engine.parse(p)\nexcept ParserError as e:\n    out = txt_fallback(p)","handlingStrategy":"fallback","validationCode":"def can_markitdown(p):\n    return p.is_file() and p.suffix.lower() in {\".pdf\", \".docx\", \".pptx\", \".xlsx\", \".html\"}","typeGuard":null,"tryCatchPattern":"try:\n    engine.parse(p)\nexcept ParserError:\n    engine2.parse(p)","preventionTips":["Install markitdown[all] for full format coverage.","Pre-validate extensions and file size.","Chain multiple parsing engines with fallback."],"tags":["parsing","markitdown","document-conversion"],"backgroundTag":"document-parse-failed","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}