[Patches] [ python-Patches-651621 ] small ZipFile.writestr() enhancement

noreply@sourceforge.net noreply@sourceforge.net
Tue, 10 Dec 2002 12:31:25 -0800


Patches item #651621, was opened at 2002-12-10 21:31
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=651621&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Just van Rossum (jvr)
Assigned to: Nobody/Anonymous (nobody)
Summary: small ZipFile.writestr() enhancement

Initial Comment:
This patch allows ZipFile.writestr() to be called with
an archive file name instead of a ZipInfo instance:

    z = ZipFile("myarchive.zip", "w")
    z.writestr("foo/baz/file.ext", data)
    z.close()

I find the current writestr() method very inconvenient
for simple (but common) things.

If called with a file name instead of a ZipInfo
instance, the date_time is set to now, which makes most
sense for anonymous data.

The patch also patches Doc/Lib/libzipfile.tex.

Just


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=651621&group_id=5470