mirror of https://github.com/MISP/PyMISP
Merge pull request #22 from 3c7/patch-1
Fixes: expected bytes, got <class 'str'> in download_samples()pull/24/head
commit
328e3b7a92
|
@ -917,10 +917,10 @@ class PyMISP(object):
|
||||||
archive = zipfile.ZipFile(zipped)
|
archive = zipfile.ZipFile(zipped)
|
||||||
try:
|
try:
|
||||||
# New format
|
# New format
|
||||||
unzipped = BytesIO(archive.open(f['md5'], pwd='infected').read())
|
unzipped = BytesIO(archive.open(f['md5'], pwd=b'infected').read())
|
||||||
except KeyError:
|
except KeyError:
|
||||||
# Old format
|
# Old format
|
||||||
unzipped = BytesIO(archive.open(f['filename'], pwd='infected').read())
|
unzipped = BytesIO(archive.open(f['filename'], pwd=b'infected').read())
|
||||||
details.append([f['event_id'], f['filename'], unzipped])
|
details.append([f['event_id'], f['filename'], unzipped])
|
||||||
except zipfile.BadZipfile:
|
except zipfile.BadZipfile:
|
||||||
# In case the sample isn't zipped
|
# In case the sample isn't zipped
|
||||||
|
|
Loading…
Reference in New Issue