[Bug] Support for Python 3.12 - Missing distutils
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the import failure with Python 3.12 and trace the dependency chain through mitreattack/collections/stix_to_collection.py, stix2elevator, stix, and mixbox/parser.py. Review related issue 163 to determine whether removing STIX1 support is the intended direction; done means the library imports successfully under Python 3.12 without the missing distutils module.
Written by the indexing model from the issue text.
Description
Expected Behavior
The library should function under Python3.12
Actual Behavior
The library attempts to load the distutils module, which was removed in Python3.12. See https://docs.python.org/3.10/library/distutils.html for background on the deprecation and removal of distutils.
Steps to Reproduce the Problem
- Install mitreattack-python with
python3 -m pip install mitreattack-python - Run python3 and attempt to load library:
% python3 --version
Python 3.12.4
% python3
Python 3.12.4 (main, Jun 6 2024, 18:26:44) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from mitreattack.navlayers.core import Layer
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jessek/tmp/lib/python3.12/site-packages/mitreattack/__init__.py", line 3, in <module>
from .collections import *
File "/Users/jessek/tmp/lib/python3.12/site-packages/mitreattack/collections/__init__.py", line 3, in <module>
from .stix_to_collection import *
File "/Users/jessek/tmp/lib/python3.12/site-packages/mitreattack/collections/stix_to_collection.py", line 9, in <module>
from stix2elevator.stix_stepper import step_bundle
File "/Users/jessek/tmp/lib/python3.12/site-packages/stix2elevator/__init__.py", line 12, in <module>
from stix.core import STIXPackage
File "/Users/jessek/tmp/lib/python3.12/site-packages/stix/__init__.py", line 5, in <module>
from .base import (Entity, EntityList, TypedCollection, TypedList, # noqa
File "/Users/jessek/tmp/lib/python3.12/site-packages/stix/base.py", line 20, in <module>
from . import utils
File "/Users/jessek/tmp/lib/python3.12/site-packages/stix/utils/__init__.py", line 382, in <module>
from .parser import * # noqa
^^^^^^^^^^^^^^^^^^^^^
File "/Users/jessek/tmp/lib/python3.12/site-packages/stix/utils/parser.py", line 7, in <module>
import mixbox.parser
File "/Users/jessek/tmp/lib/python3.12/site-packages/mixbox/parser.py", line 5, in <module>
from distutils.version import StrictVersion
ModuleNotFoundError: No module named 'distutils'
>>>
Possible Solution
This may be related to https://github.com/mitre-attack/mitreattack-python/issues/163, and removing support for STIX1 will remove the dependency.
- Dominant language
- HTML
- Stars
- 743
- Forks
- 176
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mitre-attack/mitreattack-python
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
mitre-attack/mitreattack-python#207 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
mitre-attack/mitreattack-python#188 · 1 comment ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
mitre-attack/mitreattack-python#183 · 2 comments · 1 reaction ·
-
[Request] OWL export Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in mitre-attack/mitreattack-python
Similar issues
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100