OALabs / hashdb-ida

HashDB API hash lookup plugin for IDA Pro
BSD 3-Clause "New" or "Revised" License
296 stars 39 forks source link

TypeError: unsupported operand type(s) for |: 'type' and 'type' #21

Closed peta909 closed 3 years ago

peta909 commented 3 years ago

Hi,

Thank you for sharing this fantastic plugin!

I was using hashdb in latest version of ida pro on win 7 x64 python 3.8 the following line of code threw the above error.

HASHDB_REQUEST_TIMEOUT: int | float = 15 # Limit to 15 seconds

I realised its because python 3.8 doesn't support use of '|' as an Union operator.

I guess the work around is to modify the code to fall back to "Union". as I prefer to work with win 7 and the last of python it supports is 3.8 :(

Just wanted to let you guys know in case someone else faced the same issue.

anthonyprintup commented 3 years ago

Hi, thanks for posting the issue. Would be awesome if you could hop onto the discord where we could discuss about it in more detail. You can find an invite in the readme. Thanks in advance.

herrcore commented 3 years ago
hashdb.py: unsupported operand type(s) for |: 'type' and 'type'
Traceback (most recent call last):
  File "[redacted]/ida_idaapi.py", line 616, in IDAPython_ExecScript
    exec(code, g)
  File "hashdb.py", line 88, in <module>
    HASHDB_REQUEST_TIMEOUT: int | float = 15 # Limit to 15 seconds
TypeError: unsupported operand type(s) for |: 'type' and 'type'

Under:

Python 3.8.2 (default, Jun  8 2021, 11:59:35) 
[Clang 12.0.5 (clang-1205.0.22.11)] 
IDAPython v7.4.0 final (serial 0) (c) The IDAPython Team <idapython@googlegroups.com>

Version 7.6.210427 macOS arm64 (32-bit address size)

Same issue as above... earlier Python versions don't support union. We need to support these versions 3.8 isn't that old and I think we will find a lot of ppl not using the bleeding edge....

herrcore commented 3 years ago

Workaround: for now we can use v1.6.0 without any significant feature impacts but we should support Py 3.8 going forward.

anthonyprintup commented 3 years ago

Resolved with #22