From a99732aaf2e84e2c08e976f05e98e2d7aa96c7d5 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 4 Jan 2017 00:42:06 +0530 Subject: [PATCH] Project tests: Also catch ValueError It seems on Windows, deleting in a loop can cause a race where the following error is raised: Traceback (most recent call last): File "run_project_tests.py", line 550, in (passing_tests, failing_tests, skipped_tests) = run_tests(all_tests, 'meson-test-run', options.extra_args) File "run_project_tests.py", line 416, in run_tests result = result.result() File "C:\python34-x64\lib\concurrent\futures\_base.py", line 402, in result return self.__get_result() File "C:\python34-x64\lib\concurrent\futures\_base.py", line 354, in __get_result raise self._exception ValueError: I/O operation on closed file. https://ci.appveyor.com/project/jpakkane/meson/build/1.0.1559/job/vsek754eu000kg3e --- run_project_tests.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/run_project_tests.py b/run_project_tests.py index c26b885e9..18988fb32 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -58,6 +58,11 @@ class AutoDeletedDir(): try: shutil.rmtree(self.dir) return + # Sometimes we get: ValueError: I/O operation on closed file. + except ValueError: + return + # Deleting can raise OSError or PermissionError on Windows + # (most likely because of anti-virus locking the file) except (OSError, PermissionError): if i == retries - 1: mlog.warning('Could not delete temporary directory.')