Unstructured-IO/unstructured

bug/file type detection fallback strategy not working

Opened this issue · 0 comments

Describe the bug
The following line tried to detect whether libmagic has been installed, but it actually only detects the installation of python-magic package instead of the true libmagic dependency.

LIBMAGIC_AVAILABLE = bool(importlib.util.find_spec("magic"))

Therefore, as long as python-magic is installed, LIBMAGIC_AVAILABLE will always be True, and if libmagic is not installed, import magic will cause an error.