summaryrefslogtreecommitdiff
path: root/Lib/test/test_bz2.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-05-12 11:57:26 +0200
committerGeorg Brandl <georg@python.org>2013-05-12 11:57:26 +0200
commit39e7a7ee0710ee9e27d1d2afc1405ef032f440ec (patch)
treecf3741c207188ee89223fceeb89c3d3b6bd01b1b /Lib/test/test_bz2.py
parent4042e5b2c7e6663694881126d93b8ba99e647c5e (diff)
downloadcpython-39e7a7ee0710ee9e27d1d2afc1405ef032f440ec.tar.gz
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 df7e18cbaf..912fac1c33 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()