From 3fb7124182ab0abab10c510b39d562480f1b8222 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= <sybren@stuvel.eu>
Date: Thu, 10 Jan 2019 17:17:20 +0100
Subject: [PATCH] Also catch FileNotFoundError when doing a write check

This error is raised when the parent directory of a write check location
doesn't exist.
---
 flamenco_worker/worker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flamenco_worker/worker.py b/flamenco_worker/worker.py
index 745aa705..9a48fb42 100644
--- a/flamenco_worker/worker.py
+++ b/flamenco_worker/worker.py
@@ -897,7 +897,7 @@ class FlamencoWorker:
                     testfile = write_path.open('a+', encoding='utf8')
                 with testfile as outfile:
                     outfile.write('♥')
-            except PermissionError:
+            except (PermissionError, FileNotFoundError):
                 raise PreTaskCheckFailed('%s is not writable' % write_path) from None
             if post_delete:
                 try:
-- 
GitLab