diff options
author | Georg Brandl <georg@python.org> | 2013-05-12 09:29:27 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2013-05-12 09:29:27 (GMT) |
commit | 93b061bc3e1c9285ec1ce6405b85d3a1e072833f (patch) | |
tree | 8af0398de702f21e033f4d7960dc7f8a5cade00a /Lib/test/test_gzip.py | |
parent | a9217a42e62dc8dcf9bb6a184bcf9d5de97d2d9e (diff) | |
download | cpython-93b061bc3e1c9285ec1ce6405b85d3a1e072833f.zip cpython-93b061bc3e1c9285ec1ce6405b85d3a1e072833f.tar.gz cpython-93b061bc3e1c9285ec1ce6405b85d3a1e072833f.tar.bz2 |
Issue #1159051: Back out a fix for handling corrupted gzip files that
broke backwards compatibility.
Diffstat (limited to 'Lib/test/test_gzip.py')
-rwxr-xr-x[-rw-r--r--] | Lib/test/test_gzip.py | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index b912576..a4dfac4 100644..100755 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -365,19 +365,6 @@ class TestGzip(unittest.TestCase): datac = gzip.compress(data) self.assertEqual(gzip.decompress(datac), data) - def test_read_truncated(self): - data = data1*50 - # Drop the CRC (4 bytes) and file size (4 bytes). - truncated = gzip.compress(data)[:-8] - with gzip.GzipFile(fileobj=io.BytesIO(truncated)) as f: - self.assertRaises(EOFError, f.read) - with gzip.GzipFile(fileobj=io.BytesIO(truncated)) as f: - self.assertEqual(f.read(len(data)), data) - self.assertRaises(EOFError, f.read, 1) - # Incomplete 10-byte header. - for i in range(2, 10): - with gzip.GzipFile(fileobj=io.BytesIO(truncated[:i])) as f: - self.assertRaises(EOFError, f.read, 1) def test_read_with_extra(self): # Gzip data with an extra field |