From 0da6d50dd8df7f04140c0323663021a9fb1a630c Mon Sep 17 00:00:00 2001 From: Florian Jetter Date: Wed, 23 Mar 2022 19:07:07 +0100 Subject: [PATCH] Catch NotADirectoryError in SafeTemporaryDirectory (#5984) --- distributed/utils_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distributed/utils_test.py b/distributed/utils_test.py index dc3010cab9..c1cbfdca23 100644 --- a/distributed/utils_test.py +++ b/distributed/utils_test.py @@ -646,7 +646,7 @@ class _SafeTemporaryDirectory(tempfile.TemporaryDirectory): def __exit__(self, exc_type, exc_val, exc_tb): try: return super().__exit__(exc_type, exc_val, exc_tb) - except PermissionError: + except (PermissionError, NotADirectoryError): # It appears that we either have a process still interacting with # the tmpdirs of the workers or that win process are not releasing # their lock in time. We are receiving PermissionErrors during