This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alanmcintyre
Recipients
Date 2007-05-09.21:40:46
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
I tried out a change to set the modified flag (_didModify) if the ZipFile constructor ends up having mode  'w' or decides that it's appending to a file with no existing zip structure at the end.  I'm waiting on the full regression test suite to run against it, but it passes everything in test_zipfile.py (and I added new tests to check for the behavior with empty files).  I can post the patch if Mark hasn't had a chance to work one up yet.

The docs don't seem to say anything about what happens if you open a ZipFile in 'w' or 'a' and then just close it.  I wouldn't mind updating the docs to cover this if desired.

As a side note, when attempting to open an empty file in 'r' mode, a mostly unhelpful IOError (with message "invalid parameter") gets raised in _EndRecData when attempting to seek backwards.  It seems that it would be preferable to catch any exceptions raised by _EndRecData and raise a BadZipFile so that it's not as cryptic.
History
Date User Action Args
2007-08-23 14:53:31adminlinkissue1710703 messages
2007-08-23 14:53:31admincreate