summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bz2.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-05-12 09:29:27 (GMT)
committerGeorg Brandl <georg@python.org>2013-05-12 09:29:27 (GMT)
commit93b061bc3e1c9285ec1ce6405b85d3a1e072833f (patch)
tree8af0398de702f21e033f4d7960dc7f8a5cade00a /Lib/test/test_bz2.py
parenta9217a42e62dc8dcf9bb6a184bcf9d5de97d2d9e (diff)
downloadcpython-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_bz2.py')
-rw-r--r--Lib/test/test_bz2.py18
1 files changed, 0 insertions, 18 deletions
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
index bcf80dc..93f71fe 100644
--- a/Lib/test/test_bz2.py
+++ b/Lib/test/test_bz2.py
@@ -292,24 +292,6 @@ class BZ2FileTest(BaseTest):
self.assertRaises(ValueError, f.readline)
self.assertRaises(ValueError, f.readlines)
- def test_read_truncated(self):
- # Drop the eos_magic field (6 bytes) and CRC (4 bytes).
- truncated = self.DATA[:-10]
- with open(self.filename, 'wb') as f:
- f.write(truncated)
- with BZ2File(self.filename) as f:
- self.assertRaises(EOFError, f.read)
- with BZ2File(self.filename) as f:
- self.assertEqual(f.read(len(self.TEXT)), self.TEXT)
- self.assertRaises(EOFError, f.read, 1)
- # Incomplete 4-byte file header, and block header of at least 146 bits.
- for i in range(22):
- with open(self.filename, 'wb') as f:
- f.write(truncated[:i])
- with BZ2File(self.filename) as f:
- self.assertRaises(EOFError, f.read, 1)
-
-
class BZ2CompressorTest(BaseTest):
def testCompress(self):
# "Test BZ2Compressor.compress()/flush()"