]> granicus.if.org Git - python/commitdiff
Merged revisions 73565 via svnmerge from
authorGregory P. Smith <greg@mad-scientist.com>
Fri, 26 Jun 2009 08:05:13 +0000 (08:05 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Fri, 26 Jun 2009 08:05:13 +0000 (08:05 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73565 | gregory.p.smith | 2009-06-26 00:50:21 -0700 (Fri, 26 Jun 2009) | 2 lines

  Fixes the last problem mentioned in issue1202.
........

Issue #1202: zipfile module would cause a struct.error when attempting to store
files with a CRC32 > 2**31-1.  (on trunk this was merely a warning, in the py3k
branch this caused an exception so I'm treating this as a release blocker and
merging it now)

Lib/zipfile.py
Misc/NEWS

index 5f2418734dae8e0c4a345146a21b73aae8d42bd6..de06d820bd6431ac031d367de0bb1d66ecc87375 100644 (file)
@@ -1132,7 +1132,7 @@ class ZipFile:
         self.fp.flush()
         if zinfo.flag_bits & 0x08:
             # Write CRC and file sizes after the file data
-            self.fp.write(struct.pack("<lLL", zinfo.CRC, zinfo.compress_size,
+            self.fp.write(struct.pack("<LLL", zinfo.CRC, zinfo.compress_size,
                   zinfo.file_size))
         self.filelist.append(zinfo)
         self.NameToInfo[zinfo.filename] = zinfo
index 0f6f9018d324ebffb3cfd279cf5ea346bffbb149..32101b546e588d27aaa74ff20369051144a99c37 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -32,6 +32,9 @@ Library
 - Issue #6271: mmap tried to close invalid file handle (-1) when anonymous.
   (On Unix)
 
+- Issue #1202: zipfile module would cause a struct.error when attempting to
+  store files with a CRC32 > 2**31-1.
+
 Extension Modules
 -----------------