summaryrefslogtreecommitdiff
path: root/Lib/test/test_bz2.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_bz2.py')
-rw-r--r--Lib/test/test_bz2.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
index 7d844d8e83..fc8213f55a 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()"