scVENUS / PeekabooAV

Peekaboo Extended Email Attachment Behavior Observation Owl
https://peekabooav.de
GNU General Public License v3.0
66 stars 20 forks source link

python3.10 incompatibility of colorclass affecting us via oletools #191

Closed michaelweiser closed 2 years ago

michaelweiser commented 3 years ago

As a heads-up: I just got the following backtrace when trying to run the testsuite with CPython 3.10.0b4:

Traceback (most recent call last):
  File "/PeekabooAV/tests/test.py", line 53, in <module>
    from peekaboo.ruleset.engine import RulesetEngine
  File "/PeekabooAV/peekaboo/ruleset/engine.py", line 29, in <module>
    from peekaboo.ruleset.rules import *
  File "/PeekabooAV/peekaboo/ruleset/rules.py", line 38, in <module>
    from peekaboo.toolbox.ole import Oletools, OletoolsReport
  File "/PeekabooAV/peekaboo/toolbox/ole.py", line 29, in <module>
    from oletools.olevba import VBA_Parser, FileOpenError
  File "/PeekabooAV-dev/lib/python3.10/site-packages/oletools/olevba.py", line 307, in <module>
    import colorclass
  File "/PeekabooAV-dev/lib/python3.10/site-packages/colorclass/__init__.py", line 11, in <module>
    from colorclass.codes import list_tags  # noqa
  File "/PeekabooAV-dev/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)

This appears to be caused by Robpol86/colorclass#27 hitting us via oletools. In contrast to the PR, it does still work with CPython 3.9 but no longer in 3.10. Not much we can do about it but monitor or push for an upstream fix either in colorclass or oletools (e.g. by making usage of colorclass optional).

michaelweiser commented 3 years ago

Upstream repo is archived. Other project referencing the PR came to the conclusion, colorclass appears to be unmaintained and is looking to replace it. So we'd need to talk to decalage2/oletools about their plans.

iliyas2008 commented 2 years ago

when will this issue be resolved???

michaelweiser commented 2 years ago

I have reached out to oletools upstream at decalage2/oletools#709. A fix is scheduled for oletools 0.60. You could give your thumbs up or other input there to speed it along. You can work around the problem for the time being by changing your local installation of colorclass to import Mapping from collections.abc as shown in the propsed patch[1]. I have no plans currently to somehow work around this in PeekabooAV or PeekabooAV-Installer.

[1] https://github.com/Robpol86/colorclass/pull/27/commits/f8bbe9fdcff1d97b1d0e5dcb94680923cc43a507

michaelweiser commented 2 years ago

This has been fixed by a new release 2.2.2 of colorclass by a new maintainer.