summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tarfile.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2004-08-22 21:28:33 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2004-08-22 21:28:33 (GMT)
commitc234a5245814af7334b5b35cd643b603b7525b50 (patch)
treeee997741da9f9e733cfafd523f839a99bb5d7009 /Lib/test/test_tarfile.py
parent70aa1f20951a443dcd6387a23a8835bde596055f (diff)
downloadcpython-c234a5245814af7334b5b35cd643b603b7525b50.zip
cpython-c234a5245814af7334b5b35cd643b603b7525b50.tar.gz
cpython-c234a5245814af7334b5b35cd643b603b7525b50.tar.bz2
Flush bz2 data even if nothing had been written so far. Fixes #1013882.
Will backport to 2.3.
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r--Lib/test/test_tarfile.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index 52b6204..6615602 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -177,7 +177,8 @@ class WriteTest(BaseTest):
def setUp(self):
mode = self.mode + self.sep + self.comp
self.src = tarfile.open(tarname(self.comp), 'r')
- self.dst = tarfile.open(tmpname(), mode)
+ self.dstname = tmpname()
+ self.dst = tarfile.open(self.dstname, mode)
def tearDown(self):
self.src.close()
@@ -191,6 +192,11 @@ class WriteTest(BaseTest):
self.dst.posix = 0
self._test()
+ def test_small(self):
+ self.dst.add(os.path.join(os.path.dirname(__file__),"cfgparser.1"))
+ self.dst.close()
+ self.assertNotEqual(os.stat(self.dstname).st_size, 0)
+
def _test(self):
for tarinfo in self.src:
if not tarinfo.isreg():