Caught exception on python3.4 where base64encode returns bytes and not str, and bytes are not json encodable. This caused a failure in upload_sample

pull/24/head
Kenneth Adam Miller 2016-07-27 07:30:46 -04:00
parent 7c6b095a05
commit 90b772d938
1 changed files with 1 additions and 1 deletions

View File

@ -677,7 +677,7 @@ class PyMISP(object):
def _encode_file_to_upload(self, path):
with open(path, 'rb') as f:
return base64.b64encode(f.read())
return str(base64.b64encode(f.read()))
def upload_sample(self, filename, filepath, event_id, distribution, to_ids,
category, comment, info, analysis, threat_level_id):