Index: Lib/zipfile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/zipfile.py,v retrieving revision 1.26 diff -c -r1.26 zipfile.py *** Lib/zipfile.py 13 Oct 2002 13:54:50 -0000 1.26 --- Lib/zipfile.py 10 Dec 2002 21:26:43 -0000 *************** *** 447,455 **** self.filelist.append(zinfo) self.NameToInfo[zinfo.filename] = zinfo ! def writestr(self, zinfo, bytes): """Write a file into the archive. The contents is the string ! 'bytes'.""" self._writecheck(zinfo) zinfo.file_size = len(bytes) # Uncompressed size zinfo.CRC = binascii.crc32(bytes) # CRC-32 checksum --- 447,462 ---- self.filelist.append(zinfo) self.NameToInfo[zinfo.filename] = zinfo ! def writestr(self, zinfo_or_arcname, bytes): """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())) ! zinfo.compress_type = self.compression ! else: ! zinfo = zinfo_or_arcname self._writecheck(zinfo) zinfo.file_size = len(bytes) # Uncompressed size zinfo.CRC = binascii.crc32(bytes) # CRC-32 checksum Index: Doc/lib/libzipfile.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libzipfile.tex,v retrieving revision 1.14 diff -c -r1.14 libzipfile.tex *** Doc/lib/libzipfile.tex 9 Apr 2002 18:15:00 -0000 1.14 --- Doc/lib/libzipfile.tex 10 Dec 2002 21:26:43 -0000 *************** *** 146,156 **** \code{'a'}. \end{methoddesc} ! \begin{methoddesc}{writestr}{zinfo, bytes} ! Write the string \var{bytes} to the archive; meta-information is ! given as the \class{ZipInfo} instance \var{zinfo}. At least the ! filename, date, and time must be given by \var{zinfo}. The archive ! must be opened with mode \code{'w'} or \code{'a'}. \end{methoddesc} --- 146,158 ---- \code{'a'}. \end{methoddesc} ! \begin{methoddesc}{writestr}{zinfo_or_arcname, bytes} ! Write the string \var{bytes} to the archive; \var{zinfo_or_arcname} ! is either the file name it will be given in the archive, or a ! \class{ZipInfo} instance. If it's an instance, at least the ! filename, date, and time must be given. If it's a name, the date ! and time is set to the current date and time. The archive must be ! opened with mode \code{'w'} or \code{'a'}. \end{methoddesc}