I have a 1.4GB zip file and am trying to yield each member in succession. The zipfile module keeps throwing a BadZipfile exception, stating that
"zipfile.BadZipfile: zipfiles that span multiple disks are not supported".
Here is my code:
import zipfile
def iterate_members(zip_file_like_object):
zflo = zip_file_like_object
assert zipfile.is_zipfile(zflo) # Here is where the error happens.
# If I comment out the assert, the same error gets thrown on this next line:
with zipfile.ZipFile(zflo) as zip:
members = zip.namelist()
for member in members:
yield member
fn = "filename.zip"
iterate_members(open(fn, 'rb'))
I'm using Python 2.7.3. I tried on both Windows 8 and ubuntu with the same result. Any help very much appreciated.