summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bz2.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-05-12 09:57:26 (GMT)
committerGeorg Brandl <georg@python.org>2013-05-12 09:57:26 (GMT)
commitb3bd624a55ea5bf3a0e77cfa9d987d82ed23652f (patch)
tree6f3eec34ee852fdb40cf731f2c422d4831fd2e15 /Lib/test/test_bz2.py
parent64949fa20e4845e92a1d42f581a47b559a9acd25 (diff)
downloadcpython-b3bd624a55ea5bf3a0e77cfa9d987d82ed23652f.zip
cpython-b3bd624a55ea5bf3a0e77cfa9d987d82ed23652f.tar.gz
cpython-b3bd624a55ea5bf3a0e77cfa9d987d82ed23652f.tar.bz2
Back out patch for #1159051, which caused backwards compatibility problems.
Diffstat (limited to 'Lib/test/test_bz2.py')
-rw-r--r--Lib/test/test_bz2.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
index df7e18c..912fac1 100644
--- a/Lib/test/test_bz2.py
+++ b/Lib/test/test_bz2.py
@@ -577,20 +577,6 @@ class BZ2FileTest(BaseTest):
bz2f.seek(-150, 1)
self.assertEqual(bz2f.read(), self.TEXT[500-150:])
- def test_read_truncated(self):
- # Drop the eos_magic field (6 bytes) and CRC (4 bytes).
- truncated = self.DATA[:-10]
- with BZ2File(BytesIO(truncated)) as f:
- self.assertRaises(EOFError, f.read)
- with BZ2File(BytesIO(truncated)) 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 BZ2File(BytesIO(truncated[:i])) as f:
- self.assertRaises(EOFError, f.read, 1)
-
-
class BZ2CompressorTest(BaseTest):
def testCompress(self):
bz2c = BZ2Compressor()