Commit 2d5a0928 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #20384: Fix the test_tarfile test on Windows.

On Windows os.open() error message doesn't contain file name.
parent f0b463ad
...@@ -239,7 +239,12 @@ class CommonReadTest(ReadTest): ...@@ -239,7 +239,12 @@ class CommonReadTest(ReadTest):
def test_non_existent_tarfile(self): def test_non_existent_tarfile(self):
# Test for issue11513: prevent non-existent gzipped tarfiles raising # Test for issue11513: prevent non-existent gzipped tarfiles raising
# multiple exceptions. # 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) tarfile.open("xxx", self.mode)
def test_null_tarfile(self): def test_null_tarfile(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment