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

colorclass dependency causes incompatibility with CPython 3.10 #709

Open
michaelweiser opened this issue Aug 5, 2021 · 3 comments
Open

Comments

@michaelweiser
Copy link

oletools.olevba will fail on import in the colorclass dependency in CPython 3.10:

$ oletools/bin/python3.10 -c "import oletools.olevba"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/oletools/lib/python3.10/site-packages/oletools/olevba.py", line 307, in <module>
    import colorclass
  File "/oletools/lib/python3.10/site-packages/colorclass/__init__.py", line 11, in <module>
    from colorclass.codes import list_tags  # noqa
  File "/oletools/lib/python3.10/site-packages/colorclass/codes.py", line 4, in <module>
    from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)

There's a fix proposed at the upstream repository: Robpol86/colorclass#27. It does not look like it's going to be adopted any time soon.

Would you consider making the dependency optional or otherwise work around the problem?

Additional info:

$ python3.10 -V
Python 3.10.0b4
$ python3.10 -mvenv oletools
$ oletools/bin/pip install oletools
Collecting oletools
  Using cached oletools-0.60-py2.py3-none-any.whl (968 kB)
Collecting easygui
  Using cached easygui-0.98.2-py2.py3-none-any.whl (92 kB)
Collecting pcodedmp>=1.2.5
  Using cached pcodedmp-1.2.6-py2.py3-none-any.whl (30 kB)
Collecting msoffcrypto-tool
  Using cached msoffcrypto_tool-4.12.0-py2.py3-none-any.whl (33 kB)
Collecting olefile>=0.46
  Using cached olefile-0.46.zip (112 kB)
Collecting colorclass
  Using cached colorclass-2.2.0.tar.gz (17 kB)
Collecting pyparsing<3,>=2.1.0
  Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Collecting cryptography>=2.3
  Using cached cryptography-3.4.7-cp36-abi3-manylinux2014_x86_64.whl (3.2 MB)
Collecting cffi>=1.12
  Using cached cffi-1.14.6.tar.gz (475 kB)
Collecting pycparser
  Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB)
Using legacy 'setup.py install' for olefile, since package 'wheel' is not installed.
Using legacy 'setup.py install' for colorclass, since package 'wheel' is not installed.
Using legacy 'setup.py install' for cffi, since package 'wheel' is not installed.
Installing collected packages: pycparser, cffi, olefile, cryptography, pyparsing, pcodedmp, msoffcrypto-tool, easygui, colorclass, oletools
    Running setup.py install for cffi ... done
    Running setup.py install for olefile ... done
    Running setup.py install for colorclass ... done
Successfully installed cffi-1.14.6 colorclass-2.2.0 cryptography-3.4.7 easygui-0.98.2 msoffcrypto-tool-4.12.0 olefile-0.46 oletools-0.60 pcodedmp-1.2.6 pycparser-2.20 pyparsing-2.4.7
WARNING: You are using pip version 21.1.3; however, version 21.2.2 is available.
You should consider upgrading via the '/oletools/bin/python3.10 -m pip install --upgrade pip' command.
@michaelweiser
Copy link
Author

There's been a new release 2.2.2 of colorclass with includes the fix. The problem is gone in my tests. So I believe this issue can be closed.

@decalage2
Copy link
Owner

I confirm this works fine with the new fork of colorclass (https://github.com/matthewdeanmartin/colorclass) on Python 3.10. pip installs colorclass 2.2.2 when upgrading (pip install -U colorclass).

@decalage2
Copy link
Owner

Actually I should update the dependency requirements in setup.py to force the upgrade to colorclass>=2.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants