summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-03-25 06:12:45 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-03-25 06:12:45 (GMT)
commit88440960f9f430581ba5766aee1f0712ac96cb54 (patch)
tree763bc7cbf8bf1205ff1a1f3b91a4cd40bfdf61e4 /Lib/tarfile.py
parent4677fbf7de591d0cea0d1aeaa9639ee46faa48f5 (diff)
downloadcpython-88440960f9f430581ba5766aee1f0712ac96cb54.zip
cpython-88440960f9f430581ba5766aee1f0712ac96cb54.tar.gz
cpython-88440960f9f430581ba5766aee1f0712ac96cb54.tar.bz2
A stab in the dark attempt to fix the alpha/tru64 buildbot problem and add more
test coverage of valid inputs to zlib.crc32.
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 92fdb7b..4991ae1 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -420,7 +420,7 @@ class _Stream:
except ImportError:
raise CompressionError("zlib module is not available")
self.zlib = zlib
- self.crc = zlib.crc32("")
+ self.crc = zlib.crc32("") & 0xffffffffL
if mode == "r":
self._init_read_gz()
else:
@@ -458,7 +458,7 @@ class _Stream:
"""Write string s to the stream.
"""
if self.comptype == "gz":
- self.crc = self.zlib.crc32(s, self.crc)
+ self.crc = self.zlib.crc32(s, self.crc) & 0xffffffffL
self.pos += len(s)
if self.comptype != "tar":
s = self.cmp.compress(s)