[Python-checkins] cpython (3.3): Issue #20384: Fix the test_tarfile test on Windows.

serhiy.storchaka python-checkins at python.org
Fri Jan 24 21:20:23 CET 2014


http://hg.python.org/cpython/rev/69d885ac042d
changeset:   88676:69d885ac042d
branch:      3.3
parent:      88672:fc62fcd8e990
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Fri Jan 24 22:19:23 2014 +0200
summary:
  Issue #20384: Fix the test_tarfile test on Windows.

On Windows os.open() error message doesn't contain file name.

files:
  Lib/test/test_tarfile.py |  7 ++++++-
  1 files changed, 6 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -239,7 +239,12 @@
     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):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list