diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-18 13:54:32 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-18 13:54:32 (GMT) |
commit | cdf1ebd8feff4b1d9410f10a7c7c51a7cecad65a (patch) | |
tree | dc7bad832e512a5f042cd2d9edbce561d752ccfb /Lib/test/test_tarfile.py | |
parent | 75ba21a77d41be2a4d5f824363e69d45bcba1ec4 (diff) | |
download | cpython-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.py | 6 |
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): |