Issue611760
Created on 2002年09月19日 19:29 by ahlstromjc, last changed 2022年04月10日 16:05 by admin. This issue is now closed.
| Files |
| File name |
Uploaded |
Description |
Edit |
|
zipfile.diff
|
ahlstromjc,
2002年09月19日 19:29
|
diff -c against today's CVS zipfile.py Rev. 1.25 |
|
comment.zip
|
ahlstromjc,
2002年09月20日 14:07
|
ZIP file with an archive comment |
| Messages (4) |
|
msg41170 - (view) |
Author: James C. Ahlstrom (ahlstromjc) |
Date: 2002年09月19日 19:29 |
Module zipfile can not read ZIP archives which have
appended archive comments. I have only gotten two
complaints about this, but I feel that this limitation
should be removed. Archive comments are appended to
ZIP archives, and can be up to 64K bytes long. Reading
them would require searching the end of the archive for
the end record magic number.
The attached patch will (1) seek and verify a zero
length comment; and if this fails (2) search the last
4K bytes of the file for a comment. The 4K limitation
(down from 64K) is for efficiency.
This was tested on Python 2.2.1, but zipfile.py has
changed since then. So the patch was hand edited into
today's CVS zipfile.py version.
|
|
msg41171 - (view) |
Author: Martin v. Löwis (loewis) * (Python committer) |
Date: 2002年09月20日 12:57 |
Logged In: YES
user_id=21627
Can you please attach an example zipfile to test this patch?
|
|
msg41172 - (view) |
Author: James C. Ahlstrom (ahlstromjc) |
Date: 2002年09月20日 14:07 |
Logged In: YES
user_id=64929
OK, here is a ZIP file which has an archive (appended)
multiline comment. The comment is available as the
attribute ZipFile::comment. I didn't add code to write ZIP
files with comments. We don't need that, right?
|
|
msg41173 - (view) |
Author: Martin v. Löwis (loewis) * (Python committer) |
Date: 2002年10月13日 13:55 |
Logged In: YES
user_id=21627
Thanks for the patch. Applied as zipfile.py 1.26;
|
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2022年04月10日 16:05:41 | admin | set | github: 37196 |
| 2002年09月19日 19:29:21 | ahlstromjc | create |