clearbluejar / ghidriff

Python Command-Line Ghidra Binary Diffing Engine
https://clearbluejar.github.io/ghidriff/
GNU General Public License v3.0
476 stars 22 forks source link

Error starting ghidriff: AttributeError: module 'argparse' has no attribute 'BooleanOptionalAction' #76

Closed ameygat closed 5 months ago

ameygat commented 6 months ago

I have python 3.8.5 version and installed ghidriff 0.6.0 via pip install. But unable to run ghidriff due to following error:

(envp3) remnux@remnux:~$ python --version Python 3.8.5 (envp3) remnux@remnux:~$ ghidriff --version Traceback (most recent call last): File "/home/remnux/envp3/bin/ghidriff", line 8, in sys.exit(main()) File "/home/remnux/envp3/lib/python3.8/site-packages/ghidriff/main.py", line 16, in main GhidraDiffEngine.add_ghidra_args_to_parser(parser) File "/home/remnux/envp3/lib/python3.8/site-packages/ghidriff/ghidra_diff_engine.py", line 178, in add_ghidra_args_to_parser default=True, action=argparse.BooleanOptionalAction) AttributeError: module 'argparse' has no attribute 'BooleanOptionalAction' (envp3) remnux@remnux:~$

Here is outout of pip install if required:

(envp3) remnux@remnux:~$ pip install ghidriff Collecting ghidriff Downloading ghidriff-0.6.0-py3-none-any.whl (69 kB) |████████████████████████████████| 69 kB 1.7 MB/s Collecting pyhidra Downloading pyhidra-0.5.4-py3-none-any.whl (44 kB) |████████████████████████████████| 44 kB 891 kB/s Collecting mdutils Downloading mdutils-1.6.0.tar.gz (22 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Collecting Jpype1>=1.3.0 Downloading JPype1-1.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (488 kB) |████████████████████████████████| 488 kB 6.4 MB/s Requirement already satisfied: packaging in ./envp3/lib/python3.8/site-packages (from Jpype1>=1.3.0->pyhidra->ghidriff) (20.3) Building wheels for collected packages: mdutils Building wheel for mdutils (PEP 517) ... done Created wheel for mdutils: filename=mdutils-1.6.0-py3-none-any.whl size=20726 sha256=3386337cca801ddbf3158c4b1e751b7ce18bca91b6ca2d6541752beaf9a59018 Stored in directory: /home/remnux/.cache/pip/wheels/03/79/c8/aeb76ee5b49ed6079956ea4f3b48b7dbcb9503c11d42e99063 Successfully built mdutils Installing collected packages: Jpype1, pyhidra, mdutils, ghidriff Successfully installed Jpype1-1.5.0 ghidriff-0.6.0 mdutils-1.6.0 pyhidra-0.5.4

clearbluejar commented 6 months ago

Looks like you have found a problem with the test cases as well. My current tests are lacking a Python 3.8 runtime test.

image

The booleanoptionaction can be replaced with a store_true for the argparser, I'll see what I can do.

clearbluejar commented 5 months ago

https://stackoverflow.com/questions/15008758/parsing-boolean-values-with-argparse

This!

clearbluejar commented 5 months ago

I have some bad news for Python 3.8 support. Pyhidra just dropped 3.8 support. Ghidriff will be moving to Python >= 3.9 to match Pyhidra.

See https://github.com/dod-cyber-crime-center/pyhidra/releases/tag/1.0.0