Issue #22341: Drop Python 2 workaround and document CRC initial value
Also align the parameter naming in binascii to be consistent with zlib.
diff --git a/Lib/gzip.py b/Lib/gzip.py
index 45152e4..3a2b322 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -210,7 +210,7 @@
def _init_write(self, filename):
self.name = filename
- self.crc = zlib.crc32(b"") & 0xffffffff
+ self.crc = zlib.crc32(b"")
self.size = 0
self.writebuf = []
self.bufsize = 0
@@ -261,7 +261,7 @@
if length > 0:
self.fileobj.write(self.compress.compress(data))
self.size += length
- self.crc = zlib.crc32(data, self.crc) & 0xffffffff
+ self.crc = zlib.crc32(data, self.crc)
self.offset += length
return length
@@ -381,7 +381,7 @@
self._last_mtime = None
def _init_read(self):
- self._crc = zlib.crc32(b"") & 0xffffffff
+ self._crc = zlib.crc32(b"")
self._stream_size = 0 # Decompressed size of unconcatenated stream
def _read_exact(self, n):
@@ -485,7 +485,7 @@
return uncompress
def _add_read_data(self, data):
- self._crc = zlib.crc32(data, self._crc) & 0xffffffff
+ self._crc = zlib.crc32(data, self._crc)
self._stream_size = self._stream_size + len(data)
def _read_eof(self):