Message31920
In short, ZipFile() will not write the Central Directory entry unless you have added a file to it. That makes it impossible to create a valid empty zip archive.
In one of my applications, I have the need to extract a partial set of information from one zip file and insert it into another. There are valid use cases where the source zip archive will not have any of the files which I am looking for. In Python 2.4, I would end up with an empty file which was considered to be a valid empty zip archive. In Python 2.5, an empty file is not considered a valid zip archive.
One would reasonably expect that creating a new ZipFile(mode="r") and successfully closing it without writing any entries would result in a valid zip archive that could be re-opened later without throwing an exception.
|
|
Date |
User |
Action |
Args |
2007-08-23 14:53:30 | admin | link | issue1710703 messages |
2007-08-23 14:53:30 | admin | create | |
|