summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-12-14 18:00:06 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2009-12-14 18:00:06 (GMT)
commit77b338be20f29712c0774e7c2d36d7afb541e4b6 (patch)
tree071314bbc64d33e1cb3284764a1c7f2f13423bea /Lib/tarfile.py
parent338eae3460be044e1af9c590dff1a15baaa0520a (diff)
downloadcpython-77b338be20f29712c0774e7c2d36d7afb541e4b6.zip
cpython-77b338be20f29712c0774e7c2d36d7afb541e4b6.tar.gz
cpython-77b338be20f29712c0774e7c2d36d7afb541e4b6.tar.bz2
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/tarfile.py')
-rw-r--r--Lib/tarfile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 7a67e15..7f08a98 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -410,7 +410,7 @@ class _Stream:
except ImportError:
raise CompressionError("zlib module is not available")
self.zlib = zlib
- self.crc = zlib.crc32("")
+ self.crc = zlib.crc32(b"")
if mode == "r":
self._init_read_gz()
else: