Skip to content

Commit 2d0589b

Browse files
committed
The code to write timestamps couldn't handle negative times (and time
on the Mac is negativevalues > 0x80000000). Fixed.
1 parent 0009c4e commit 2d0589b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎Lib/gzip.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ def write32(output, value):
1919
output.write(struct.pack("<l", value))
2020

2121
def write32u(output, value):
22+
if value < 0:
23+
value = value + 0x100000000L
2224
output.write(struct.pack("<L", value))
2325

2426
def read32(input):

0 commit comments

Comments
 (0)