From 90b772d9389f23fa621707378ebd740e35597414 Mon Sep 17 00:00:00 2001 From: Kenneth Adam Miller Date: Wed, 27 Jul 2016 07:30:46 -0400 Subject: [PATCH] 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 --- pymisp/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymisp/api.py b/pymisp/api.py index 266fb35..b5560ce 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -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):