mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Flush bz2 data even if nothing had been written so far. Fixes #1013882.
Will backport to 2.3.
This commit is contained in:
parent
70aa1f2095
commit
c234a52458
2 changed files with 9 additions and 3 deletions
|
@ -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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue