summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tarfile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-01-24 20:19:23 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-01-24 20:19:23 (GMT)
commit2d5a0928f1db9beca9e5339c31d8fca6240c49e0 (patch)
tree932dc0c692d97d4d1374a6ddb73fa5a43ae3ec6e /Lib/test/test_tarfile.py
parentf0b463ad845c7433a0c561ef2c71d350f4b508c5 (diff)
downloadcpython-2d5a0928f1db9beca9e5339c31d8fca6240c49e0.zip
cpython-2d5a0928f1db9beca9e5339c31d8fca6240c49e0.tar.gz
cpython-2d5a0928f1db9beca9e5339c31d8fca6240c49e0.tar.bz2
Issue #20384: Fix the test_tarfile test on Windows.
On Windows os.open() error message doesn't contain file name.
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r--Lib/test/test_tarfile.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index f22b908..57fc062 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -239,7 +239,12 @@ class CommonReadTest(ReadTest):
def test_non_existent_tarfile(self):
# Test for issue11513: prevent non-existent gzipped tarfiles raising
# multiple exceptions.
- with self.assertRaisesRegex(FileNotFoundError, "xxx"):
+ test = 'xxx'
+ if sys.platform == 'win32' and '|' in self.mode:
+ # Issue #20384: On Windows os.open() error message doesn't
+ # contain file name.
+ text = ''
+ with self.assertRaisesRegex(FileNotFoundError, test):
tarfile.open("xxx", self.mode)
def test_null_tarfile(self):