ZipFile.close(): Killed one of the struct.pack deprecation
authorTim Peters <tim.peters@gmail.com>
Mon, 31 Jul 2006 02:40:23 +0000 (02:40 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 31 Jul 2006 02:40:23 +0000 (02:40 +0000)
warnings on Win32.

Also added an XXX about the line:

                pos3 = self.fp.tell()

`pos3` is never referenced, and I have no idea what the code
intended to do instead.

Lib/zipfile.py

index 865267a7ccc6c71a3b608a1bc8c82bdb2c794794..2819f1bd1489dcecc6b2f2e41d19b2186b401629 100644 (file)
@@ -708,9 +708,10 @@ class ZipFile:
                         stringEndArchive64Locator, 0, pos2, 1)
                 self.fp.write(zip64locrec)
 
+                # XXX Why is `pos3` computed next?  It's never referenced.
                 pos3 = self.fp.tell()
                 endrec = struct.pack(structEndArchive, stringEndArchive,
-                         0, 0, count, count, pos2 - pos1, 0xffffffff, 0) # -1, 0)
+                            0, 0, count, count, pos2 - pos1, -1, 0)
                 self.fp.write(endrec)
 
             else: