Bugs item #1710703, was opened at 2007-05-01 11:43
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1710703&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Mark Flacy (markaflacy)
Assigned to: Nobody/Anonymous (nobody)
Summary: zipfile.ZipFile behavior inconsistent.

Initial Comment:
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.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1710703&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to