]> granicus.if.org Git - python/commitdiff
The code to write timestamps couldn't handle negative times (and time
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 21 Feb 2001 10:39:35 +0000 (10:39 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 21 Feb 2001 10:39:35 +0000 (10:39 +0000)
on the Mac is negativevalues > 0x80000000). Fixed.

Lib/gzip.py

index 8e34ed2b8d9adaaa7db68324668dbd82c64b9629..6cb90ac6f4e28264f7193e5528e25607013c07c9 100644 (file)
@@ -19,6 +19,8 @@ def write32(output, value):
     output.write(struct.pack("<l", value))
 
 def write32u(output, value):
+    if value < 0:
+        value = value + 0x100000000L
     output.write(struct.pack("<L", value))
 
 def read32(input):