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

NotADirectoryError /binwak/magic when using python module installed with setup.py #680

Closed
Timonheu opened this issue Jul 25, 2024 · 2 comments

Comments

@Timonheu
Copy link

I am running binwalk in a docker containerand am using the python module.
It is installed from the github in the Dockerfile:

RUN wget --progress=dot:giga https://github.com/ReFirmLabs/binwalk/archive/master.zip &&\
  unzip master.zip
WORKDIR ${homedir}/binwalk-master
RUN python setup.py install

However, when running

out = binwalk.scan(
                str(location),
                extract=True,
                directory=str(working_directory),
                matryoshka=True,
                depth=5,
            )

In my script, I get the following error:

  File "/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/__init__.py", line 10, in scan
  File "/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/core/module.py", line 782, in execute
  File "/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/core/module.py", line 708, in list
  File "/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/core/settings.py", line 52, in __init__
  File "/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/core/settings.py", line 78, in _magic_signature_files
  File "/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/core/settings.py", line 71, in list_files
NotADirectoryError: [Errno 20] Not a directory: '/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/magic'

I am unsure if this is a bug in my installation or not.

@Timonheu
Copy link
Author

Further information: My container is running Debian 12, and python 3.10.12.

@Timonheu
Copy link
Author

Timonheu commented Jul 25, 2024

Minimal working example that gives the same error:

import binwalk

binwalk.scan()
/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/modules/extractor.py:969: SyntaxWarning: "is" with a literal. Did you mean "=="?
/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/modules/extractor.py:984: SyntaxWarning: "is" with a literal. Did you mean "=="?
/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/modules/extractor.py:969: SyntaxWarning: "is" with a literal. Did you mean "=="?
/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/modules/extractor.py:984: SyntaxWarning: "is" with a literal. Did you mean "=="?
Traceback (most recent call last):
  File "/home/path/to/minimal_working_example.py", line 3, in <module>
    binwalk.scan()
  File "/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/__init__.py", line 10, in scan
  File "/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/core/module.py", line 782, in execute
  File "/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/core/module.py", line 708, in list
  File "/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/core/settings.py", line 52, in __init__
  File "/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/core/settings.py", line 78, in _magic_signature_files
  File "/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/core/settings.py", line 71, in list_files
NotADirectoryError: [Errno 20] Not a directory: '/usr/local/lib/python3.10/site-packages/binwalk-2.3.3-py3.10.egg/binwalk/magic'

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

No branches or pull requests

2 participants