summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tarfile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-01-18 13:54:32 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-01-18 13:54:32 (GMT)
commitcdf1ebd8feff4b1d9410f10a7c7c51a7cecad65a (patch)
treedc7bad832e512a5f042cd2d9edbce561d752ccfb /Lib/test/test_tarfile.py
parent75ba21a77d41be2a4d5f824363e69d45bcba1ec4 (diff)
downloadcpython-cdf1ebd8feff4b1d9410f10a7c7c51a7cecad65a.zip
cpython-cdf1ebd8feff4b1d9410f10a7c7c51a7cecad65a.tar.gz
cpython-cdf1ebd8feff4b1d9410f10a7c7c51a7cecad65a.tar.bz2
Backported test for issue #20238.
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r--Lib/test/test_tarfile.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index 49469fd..8767d51 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -657,6 +657,12 @@ class WriteTestBase(unittest.TestCase):
tar.addfile(tarfile.TarInfo("foo"))
tar.close()
self.assertTrue(fobj.closed is False, "external fileobjs must never closed")
+ # Issue #20238: Incomplete gzip output with mode="w:gz"
+ data = fobj.getvalue()
+ del tar
+ test_support.gc_collect()
+ self.assertFalse(fobj.closed)
+ self.assertEqual(data, fobj.getvalue())
class WriteTest(WriteTestBase):