Close the file, and for mode 'w', 'x' and 'a' write the ending records.
zipfile/ZipFile.close
ZipFile.close