Message31923
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. |
|
Date |
User |
Action |
Args |
2007-08-23 14:53:31 | admin | link | issue1710703 messages |
2007-08-23 14:53:31 | admin | create | |
|