Try to convert event ID to integer if not None.

pull/2/merge v1.8.2
Raphaël Vinot 2015-09-13 00:31:27 +02:00
parent c133713d33
commit f731b88fde
2 changed files with 6 additions and 3 deletions

View File

@ -384,6 +384,11 @@ class PyMISP(object):
to_post = {'request': {}}
authorized_categs = ['Payload delivery', 'Artifacts dropped', 'Payload Installation', 'External Analysis']
if event_id is not None:
try:
event_id = int(event_id)
except:
pass
if not isinstance(event_id, int):
# New event
to_post['request'] = self._create_event(distribution, threat_level_id, analysis, info)
@ -543,8 +548,6 @@ class PyMISP(object):
details = []
for f in result['result']:
decoded = base64.b64decode(f['base64'])
#if not isinstance(decoded, unicode):
# decoded = decoded.encode('utf-8')
zipped = BytesIO(decoded)
archive = zipfile.ZipFile(zipped)
try:

View File

@ -4,7 +4,7 @@ from setuptools import setup
setup(
name='pymisp',
version='1.8.1',
version='1.8.2',
author='Raphaël Vinot',
author_email='raphael.vinot@circl.lu',
maintainer='Raphaël Vinot',