Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.1.1 fails to import on Python 3.8 #2061

Open
peace-maker opened this issue Dec 5, 2024 · 1 comment
Open

2.1.1 fails to import on Python 3.8 #2061

peace-maker opened this issue Dec 5, 2024 · 1 comment
Labels

Comments

@peace-maker
Copy link

While trying to use unicorn 2.1.1 on an Ubuntu 20.04 install which uses Python 3.8, it installs fine but fails to import.

>>> import unicorn
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/unicorn/__init__.py", line 4, in <module>
    from .unicorn import Uc, ucsubclass, uc_version, uc_arch_supported, version_bind, debug, UcError, __version__
  File "/usr/local/lib/python3.8/dist-packages/unicorn/unicorn.py", line 14, in <module>
    from .unicorn_py3 import *
  File "/usr/local/lib/python3.8/dist-packages/unicorn/unicorn_py3/__init__.py", line 1, in <module>
    from .unicorn import *
  File "/usr/local/lib/python3.8/dist-packages/unicorn/unicorn_py3/unicorn.py", line 200, in <module>
    uclib = __load_uc_lib()
  File "/usr/local/lib/python3.8/dist-packages/unicorn/unicorn_py3/unicorn.py", line 99, in __load_uc_lib
    resources.files("unicorn") / 'lib'
AttributeError: module 'importlib.resources' has no attribute 'files'

If Python 3.8 is supposed to be still supported (Ubuntu 20.04 is EOL in April 2025, while Python 3.8 was EOL at September 2024 -.-), then 1e04dbf introduced a regression, because importlib.resources.files was added in Python 3.9. The except block would need to catch AttributeErrors too next to ImportError.

@wtdcode
Copy link
Member

wtdcode commented Dec 5, 2024 via email

@wtdcode wtdcode added the invalid label Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants