Open progval opened 1 year ago
@progval Thanks for the detailed report. Kudos for the strace output!
So clearly typecode-libmagic==5.39.210531 and python-magic compete for attention and whichever gets imported first loads libmagic first and get a first cut at loading a magic library. AFAICR python-magic likely looks for default locations and fails as the ones provided in the pre-built are not "standard" (and not used by ScanCode FWIW since we load a well-known magic database also provided by the plugin).
There is a way for ScanCode to reuse the system-installed libmagic instead of using the typecode-libmagic plugin-provided one that should come handy for this.
Let me get you the details that will involve using scancode-toolkit-mini and https://github.com/nexB/scancode-plugins/tree/main/builtins/extractcode_libarchive_system_provided and a few extra settings
Hi,
I'd like to use both python-magic and scancode in the same process; but importing scancode first prevents python-magic from finding its files:
shows that python-magic looks for
magic.mgc
in/home/linuxbrew/.linuxbrew/Cellar/
, which doesn't exist:while, without the scancode import,
/usr/share/misc/magic.mime.mgc
is found successfully:this is on Debian 11. Python package versions: