{"record":{"id":"da906d2ec4a6b98b","repo":"microsoft/markitdown","slug":"could-not-convert-stream-to-markdown-no-converter","errorCode":null,"errorMessage":"Could not convert stream to Markdown. No converter attempted a conversion, suggesting that the filetype is simply not supported.","messagePattern":"Could not convert stream to Markdown\\. No converter attempted a conversion, suggesting that the filetype is simply not supported\\.","errorType":"exception","errorClass":"UnsupportedFormatException","httpStatus":null,"severity":"error","filePath":"packages/markitdown/src/markitdown/_markitdown.py","lineNumber":652,"sourceCode":"                            )\n                        )\n                    finally:\n                        file_stream.seek(cur_pos)\n\n                if res is not None:\n                    # Normalize the content\n                    res.text_content = \"\\n\".join(\n                        [line.rstrip() for line in re.split(r\"\\r?\\n\", res.text_content)]\n                    )\n                    res.text_content = re.sub(r\"\\n{3,}\", \"\\n\\n\", res.text_content)\n                    return res\n\n        # If we got this far without success, report any exceptions\n        if len(failed_attempts) > 0:\n            raise FileConversionException(attempts=failed_attempts)\n\n        # Nothing can handle it!\n        raise UnsupportedFormatException(\n            \"Could not convert stream to Markdown. No converter attempted a conversion, suggesting that the filetype is simply not supported.\"\n        )\n\n    def register_page_converter(self, converter: DocumentConverter) -> None:\n        \"\"\"DEPRECATED: Use register_converter instead.\"\"\"\n        warn(\n            \"register_page_converter is deprecated. Use register_converter instead.\",\n            DeprecationWarning,\n        )\n        self.register_converter(converter)\n\n    def register_converter(\n        self,\n        converter: DocumentConverter,\n        *,\n        priority: float = PRIORITY_SPECIFIC_FILE_FORMAT,\n    ) -> None:\n        \"\"\"","sourceCodeStart":634,"sourceCodeEnd":670,"githubUrl":"https://github.com/microsoft/markitdown/blob/fd239d5d2be43d9b68329730206b9312c7d5a388/packages/markitdown/src/markitdown/_markitdown.py#L634-L670","documentation":"Raised at the end of _convert_stream when failed_attempts is empty — meaning not a single registered converter's accepts() returned True for the stream_info. The library distinguishes 'converters tried and failed' (FileConversionException) from 'nobody handles this type' (UnsupportedFormatException). Typically the extension or MIME type is missing/unknown, so dispatch never happens.","triggerScenarios":"Calling md.convert(stream) with a StreamInfo lacking extension/mimetype, an exotic extension no converter claims (.xyz), or content-type detection yielding nothing that maps to a registered converter.","commonSituations":"Converting in-memory bytes while forgetting stream_info (the library cannot sniff every format from content), disabled/default-limited converter registrations, or new file formats the installed version does not know.","solutions":["Pass explicit StreamInfo: md.convert(stream, stream_info=StreamInfo(extension='.pdf', mimetype='application/pdf'))","Register a custom DocumentConverter whose accepts() recognizes your format","Pre-convert the file to a supported format (e.g. LibreOffice --convert-to docx) before markitdown","Upgrade markitdown — new versions add supported formats"],"exampleFix":"# before\nmd.convert(io.BytesIO(data))  # UnsupportedFormatException\n\n# after\nfrom markitdown import StreamInfo\nmd.convert(io.BytesIO(data), stream_info=StreamInfo(extension=\".pdf\", mimetype=\"application/pdf\"))","handlingStrategy":"validation","validationCode":"SUPPORTED_EXTS = {\".docx\", \".pdf\", \".pptx\", \".xlsx\", \".html\", \".csv\", \".json\", \".xml\", \".zip\", \".epub\", \".ipynb\", \".txt\", \".md\"}\n\ndef extension_supported(path: str, stream_info=None) -> bool:\n    ext = (stream_info.extension if stream_info else None) or os.path.splitext(path)[1].lower()\n    return ext in SUPPORTED_EXTS","typeGuard":null,"tryCatchPattern":"from markitdown import UnsupportedFormatException\n\ntry:\n    result = md.convert(stream, stream_info=stream_info)\nexcept UnsupportedFormatException:\n    log.info(\"no converter claims this type; trying plain-text fallback\")\n    result = md.convert(stream, stream_info=StreamInfo(mimetype=\"text/plain\"))","preventionTips":["Always pass StreamInfo with extension and mimetype when converting in-memory bytes","Maintain an allowlist of extensions your pipeline supports and reject others early","Register a catch-all custom converter if you must accept unknown types"],"tags":["unsupported-format","stream-info","dispatch"],"backgroundTag":null,"analyzedSha":"fd239d5d2be43d9b68329730206b9312c7d5a388","analyzedAt":"2026-08-14T15:47:51.745Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}