[Python-checkins] python/dist/src/Lib/test test_bz2.py, 1.16, 1.16.2.1
birkenfeld@users.sourceforge.net
birkenfeld at users.sourceforge.net
Fri Jun 3 21:45:55 CEST 2005
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7372/Lib/test
Modified Files:
Tag: release24-maint
test_bz2.py
Log Message:
Backport bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
Index: test_bz2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_bz2.py,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -u -d -r1.16 -r1.16.2.1
--- test_bz2.py 1 Nov 2004 17:10:19 -0000 1.16
+++ test_bz2.py 3 Jun 2005 19:45:53 -0000 1.16.2.1
@@ -235,6 +235,16 @@
# "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()"
More information about the Python-checkins
mailing list