Closed Routhinator closed 3 years ago
Yes same issue in alpine, reverting back to 0.4.22
.
Also suffering this, reverting back to 0.4.22
I reverted that specific case because the Alpine 3 docker test was passing. Can someone give me details about how to reproduce this?
Can be replicated using Docker
$ docker run -it python:3.8-alpine3.12 sh
# apk add --no-cache py3-magic
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/3) Installing python3 (3.8.10-r0)
(2/3) Installing libmagic (5.38-r0)
(3/3) Installing py3-magic (0.4.18-r0)
Executing busybox-1.31.1-r20.trigger
OK: 62 MiB in 38 packages
# pip3 install python-magic==0.4.23
Collecting python-magic==0.4.23
Downloading python_magic-0.4.23-py2.py3-none-any.whl (12 kB)
Installing collected packages: python-magic
Successfully installed python-magic-0.4.23
WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv
# python
Python 3.8.10 (default, May 4 2021, 19:15:20)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import magic
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/magic/__init__.py", line 208, in <module>
libmagic = loader.load_lib()
File "/usr/local/lib/python3.8/site-packages/magic/loader.py", line 44, in load_lib
raise ImportError('failed to find libmagic. Check your installation')
ImportError: failed to find libmagic. Check your installation
>>>
# pip3 install python-magic==0.4.22
Collecting python-magic==0.4.22
Downloading python_magic-0.4.22-py2.py3-none-any.whl (12 kB)
Installing collected packages: python-magic
Attempting uninstall: python-magic
Found existing installation: python-magic 0.4.23
Uninstalling python-magic-0.4.23:
Successfully uninstalled python-magic-0.4.23
Successfully installed python-magic-0.4.22
WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv
# python
Python 3.8.10 (default, May 4 2021, 19:15:20)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import magic
>>>
The docker test uses the alpine:3 image. Not sure why that's behaving differently from the python:3.8-alpine3.12 image here. Either way, fixed in 0.4.24 and now the test uses python:3.8-alpine3.12
4ed6b038ba8acd59ed58c888fbd18355b8955eba
Hi,
As of the new version 0.4.23 that dropped today, a regression has been introduced, breaking libmagic detection on Alpine 3:
Rolling back to 0.4.22 fixes.