Skip to content

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

@jayvdb

Description

@jayvdb

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions