diff options
author | Georg Brandl <georg@python.org> | 2005-06-03 19:47:00 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2005-06-03 19:47:00 (GMT) |
commit | 6b95f1d963d3fd2dcc2e84e83b514364e9f52006 (patch) | |
tree | 05fb825d6c8a3b148cd9462b7ab31d003de269d9 /Lib/test | |
parent | 6d6917be00942734fc8665a2398bd06087115729 (diff) | |
download | cpython-6b95f1d963d3fd2dcc2e84e83b514364e9f52006.zip cpython-6b95f1d963d3fd2dcc2e84e83b514364e9f52006.tar.gz cpython-6b95f1d963d3fd2dcc2e84e83b514364e9f52006.tar.bz2 |
Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_bz2.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py index 7d844d8..fc8213f 100644 --- a/Lib/test/test_bz2.py +++ b/Lib/test/test_bz2.py @@ -235,6 +235,16 @@ class BZ2FileTest(BaseTest): # "Test opening a nonexistent file" self.assertRaises(IOError, BZ2File, "/non/existent") + def testModeU(self): + # Bug #1194181: bz2.BZ2File opened for write with mode "U" + self.createTempFile() + bz2f = BZ2File(self.filename, "U") + bz2f.close() + f = file(self.filename) + f.seek(0, 2) + self.assertEqual(f.tell(), len(self.DATA)) + f.close() + class BZ2CompressorTest(BaseTest): def testCompress(self): # "Test BZ2Compressor.compress()/flush()" |