diff options
author | Georg Brandl <georg@python.org> | 2011-08-13 11:54:33 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2011-08-13 11:54:33 +0200 |
commit | d88e5af061c4c3206699fe7b86e736c42fdeba1c (patch) | |
tree | 8f1ac2f3c1df785a6a327f19433067d57f507277 /Lib/test/test_tarfile.py | |
parent | b3f0ce4d1ea6a48774af22e20b8f748c19f87462 (diff) | |
parent | 3abb372c810c13af4207124c175cfd0a842b5f56 (diff) | |
download | cpython-git-d88e5af061c4c3206699fe7b86e736c42fdeba1c.tar.gz |
Merge with cpython.
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r-- | Lib/test/test_tarfile.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index 8036c5cda1..b45f168990 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -1682,6 +1682,14 @@ class LinkEmulationTest(ReadTest): class GzipMiscReadTest(MiscReadTest): tarname = gzipname mode = "r:gz" + + def test_non_existent_targz_file(self): + # Test for issue11513: prevent non-existent gzipped tarfiles raising + # multiple exceptions. + with self.assertRaisesRegex(IOError, "xxx") as ex: + tarfile.open("xxx", self.mode) + self.assertEqual(ex.exception.errno, errno.ENOENT) + class GzipUstarReadTest(UstarReadTest): tarname = gzipname mode = "r:gz" |