aboutcode-org / typecode

7 stars 9 forks source link

AttributeError: module 'ctypes' has no attribute 'util' #26

Closed jayvdb closed 1 year ago

jayvdb commented 1 year ago

I get the following error on Python 3.8-3.10. Havent tried other versions.

___________________________________________________________________________________________________ ERROR collecting tests/test_types.py ____________________________________________________________________________________________________
tests/test_types.py:14: in <module>
    from filetype_test_utils import build_tests
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
/usr/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:168: in exec_module
    exec(co, module.__dict__)
tests/filetype_test_utils.py:23: in <module>
    from typecode.contenttype import get_type
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
/usr/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:168: in exec_module
    exec(co, module.__dict__)
src/typecode/__init__.py:21: in <module>
    from typecode.contenttype import get_type
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
/usr/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:168: in exec_module
    exec(co, module.__dict__)
src/typecode/contenttype.py:32: in <module>
    from typecode import magic2
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
/usr/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:168: in exec_module
    exec(co, module.__dict__)
src/typecode/magic2.py:378: in <module>
    libmagic = load_lib()
src/typecode/magic2.py:193: in load_lib
    failover_lib = load_lib_failover()
src/typecode/magic2.py:121: in load_lib_failover
    ctypes.util.find_library('magic')
E   AttributeError: module 'ctypes' has no attribute 'util'