You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During Loader registration some loaders incorrectly fail to import due to ImportError's caused by circular imports, such as the RemoteLoader (remote.py).
I ended up here because I wanted to run target-query via the debugger. Upon running:
python3 dissect/target/tools/shell.py
I get:
Traceback (most recent call last):
File "/Users/ohaalstra/Repositories/research/dissect.target/dissect/target/tools/shell.py", line 9, in <module>
import logging
File "/Users/ohaalstra/Repositories/research/dissect.target/dissect/target/tools/logging.py", line 5, in <module>
import structlog
File "/opt/homebrew/Caskroom/miniforge/base/envs/dissect-dev/lib/python3.11/site-packages/structlog/__init__.py", line 9, in <module>
from structlog import (
File "/opt/homebrew/Caskroom/miniforge/base/envs/dissect-dev/lib/python3.11/site-packages/structlog/stdlib.py", line 14, in <module>
import asyncio
File "/opt/homebrew/Caskroom/miniforge/base/envs/dissect-dev/lib/python3.11/asyncio/__init__.py", line 8, in <module>
from .base_events import *
File "/opt/homebrew/Caskroom/miniforge/base/envs/dissect-dev/lib/python3.11/asyncio/base_events.py", line 18, in <module>
import concurrent.futures
File "/opt/homebrew/Caskroom/miniforge/base/envs/dissect-dev/lib/python3.11/concurrent/futures/__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
File "/opt/homebrew/Caskroom/miniforge/base/envs/dissect-dev/lib/python3.11/concurrent/futures/_base.py", line 43, in <module>
LOGGER = logging.getLogger("concurrent.futures")
^^^^^^^^^^^^^^^^^
AttributeError: partially initialized module 'logging' has no attribute 'getLogger' (most likely due to a circular import)
This is probably because of how you execute the script. By running it as a regular Python script, the import logging statement will try to import dissect/target/tools/logging.py instead of the Python standard library logging module. Arguably a resolvable error on our end (it's generally bad practise to name files similarly to standard library modules), but also not something that will happen with normal execution of these scripts.
Try running python3 -m dissect.target.tools.shell or target-shell instead.
During
Loader
registration some loaders incorrectly fail to import due toImportError
's caused by circular imports, such as theRemoteLoader
(remote.py).The text was updated successfully, but these errors were encountered: