summaryrefslogtreecommitdiff
path: root/Lib/test/test_tarfile.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-08-13 11:48:40 +0200
committerGeorg Brandl <georg@python.org>2011-08-13 11:48:40 +0200
commit74b6abf61f88221c4c859623a75655dcb214e072 (patch)
tree610a8d7af5e56d45f94ed888adc7e2844b9dbc00 /Lib/test/test_tarfile.py
parent3672c4e21f4a886306070512354443f229c5cd0e (diff)
parent3abb372c810c13af4207124c175cfd0a842b5f56 (diff)
downloadcpython-git-74b6abf61f88221c4c859623a75655dcb214e072.tar.gz
Merge with 3.2.
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r--Lib/test/test_tarfile.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index d65e1b5187..38a5027cbb 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"