--- zipfile.py.orig 2010-03-22 09:51:08.628414597 +0100 +++ zipfile.py 2010-03-22 09:51:45.298413728 +0100 @@ -1079,14 +1079,17 @@ self.filelist.append(zinfo) self.NameToInfo[zinfo.filename] = zinfo - def writestr(self, zinfo_or_arcname, bytes): + def writestr(self, zinfo_or_arcname, bytes, compress_type=None): """Write a file into the archive. The contents is the string 'bytes'. 'zinfo_or_arcname' is either a ZipInfo instance or the name of the file in the archive.""" if not isinstance(zinfo_or_arcname, ZipInfo): zinfo = ZipInfo(filename=zinfo_or_arcname, date_time=time.localtime(time.time())[:6]) - zinfo.compress_type = self.compression + if compress_type is None: + zinfo.compress_type = self.compression + else: + zinfo.compress_type = compress_type zinfo.external_attr = 0600 << 16 else: zinfo = zinfo_or_arcname