[Patches] [ python-Patches-611760 ] zipfile.py reads archives with comments
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 20 Sep 2002 07:07:49 -0700
Patches item #611760, was opened at 2002-09-19 19:29
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=611760&group_id=5470
Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: James C. Ahlstrom (ahlstromjc)
Assigned to: Nobody/Anonymous (nobody)
Summary: zipfile.py reads archives with comments
Initial Comment:
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.
----------------------------------------------------------------------
>Comment By: James C. Ahlstrom (ahlstromjc)
Date: 2002-09-20 14:07
Message:
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?
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2002-09-20 12:57
Message:
Logged In: YES
user_id=21627
Can you please attach an example zipfile to test this patch?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=611760&group_id=5470