From cc0a039bb06c0445cec00583531880b3f5bfe60e Mon Sep 17 00:00:00 2001 From: Adam Fourney Date: Mon, 25 Nov 2024 13:42:05 -0800 Subject: [PATCH] Small fixes for the filesurfer. --- src/markitdown/__init__.py | 4 +++- src/markitdown/_markitdown.py | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/markitdown/__init__.py b/src/markitdown/__init__.py index 81ab842..482f428 100644 --- a/src/markitdown/__init__.py +++ b/src/markitdown/__init__.py @@ -2,8 +2,10 @@ # # SPDX-License-Identifier: MIT -from ._markitdown import MarkItDown +from ._markitdown import MarkItDown, FileConversionException, UnsupportedFormatException __all__ = [ "MarkItDown", + "FileConversionException", + "UnsupportedFormatException", ] diff --git a/src/markitdown/_markitdown.py b/src/markitdown/_markitdown.py index a0c479e..96997cf 100644 --- a/src/markitdown/_markitdown.py +++ b/src/markitdown/_markitdown.py @@ -999,7 +999,8 @@ def convert_response( fh.close() # Use puremagic to check for more extension options - self._append_ext(extensions, self._guess_ext_magic(temp_path)) + for g in self._guess_ext_magic(temp_path): + self._append_ext(extensions, g) # Convert result = self._convert(temp_path, extensions, url=response.url) @@ -1093,7 +1094,7 @@ def _guess_ext_magic(self, path): pass except PermissionError: pass - return None + return [] def register_page_converter(self, converter: DocumentConverter) -> None: """Register a page text converter."""