diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-12-14 18:23:30 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-12-14 18:23:30 (GMT) |
commit | c8428d3dce850a54eb49298ceabf95fc3c00867d (patch) | |
tree | d8806d53b2d52b58aaf5f083197e2141d4a8b62f /Lib/gzip.py | |
parent | 999df780d1dffdfe1e1e14122e38df098ef6f1a5 (diff) | |
download | cpython-c8428d3dce850a54eb49298ceabf95fc3c00867d.zip cpython-c8428d3dce850a54eb49298ceabf95fc3c00867d.tar.gz cpython-c8428d3dce850a54eb49298ceabf95fc3c00867d.tar.bz2 |
Merged revisions 76836 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r76836 | antoine.pitrou | 2009-12-14 19:00:06 +0100 (lun., 14 déc. 2009) | 5 lines
Issue #4757: `zlib.compress` and other methods in the zlib module now
raise a TypeError when given an `str` object (rather than a `bytes`-like
object). Patch by Victor Stinner and Florent Xicluna.
........
Diffstat (limited to 'Lib/gzip.py')
-rw-r--r-- | Lib/gzip.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/gzip.py b/Lib/gzip.py index 983e0ce..0fa4ddf 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -147,7 +147,7 @@ class GzipFile: def _init_write(self, filename): self.name = filename - self.crc = zlib.crc32("") & 0xffffffff + self.crc = zlib.crc32(b"") & 0xffffffff self.size = 0 self.writebuf = [] self.bufsize = 0 @@ -177,7 +177,7 @@ class GzipFile: self.fileobj.write(fname + b'\000') def _init_read(self): - self.crc = zlib.crc32("") & 0xffffffff + self.crc = zlib.crc32(b"") & 0xffffffff self.size = 0 def _read_gzip_header(self): |