Pull requests

#1 Merged
Repository
neilknet neilknet
Branch
default
Repository
angry_elf angry_elf
Branch
default

Close the zipfile, to ensure end-of-central-directory information is added immediately

Author
  1. Neil Kandalgaonkar
Reviewers
Description

See the docs for zipfile:

**ZipFile.close()**
Close the archive file. You must call close() before exiting your program or essential records will not be written.

They are referring to the end-of-central-directory information. if the program quits soon enough, zipfile will close the file for you, and add this information. However, if you are writing the file to a StringIO or doing other unusual things, the file will be surprisingly incomplete.

Comments (0)