AlienVault-OTX / OTX-Python-SDK

The Python SDK for AlienVault OTX
Other
359 stars 162 forks source link

Bug with IndicatorTypes.EMAIL #41

Open Te-k opened 6 years ago

Te-k commented 6 years ago

If I do res = otx.get_indicator_details_full(IndicatorTypes.EMAIL, args.EMAIL) I get the following error :

File "/home/user/env/analysis3/lib/python3.5/site-packages/OTXv2.py", line 490, in get_indicator_details_full
    for section in indicator_type.sections:
TypeError: 'NoneType' object is not iterable

Which makes sense because IndicatorTypes.EMAIL is the only one not having sections at all in IndicatorTypes.py while get_indicator_details_full use this to request information.

I have tried to fix this by adding a section but I end up having other errors :

~/env/analysis3/lib/python3.5/site-packages/OTXv2.py in get(self, url)
     81             else:
     82                 raise e
---> 83         data = response.read().decode('utf-8')
     84         json_data = json.loads(data)
     85         return json_data

AttributeError: 'NoneType' object has no attribute 'read'

I have this bug with python 3.5.2 and the pip package 1.2 (but I am pretty sure this bug is the master code)

rustybrooks commented 5 years ago

You're right. I've fixed this in master and it'll go into the next patch release.