From c7548a6f5a00ccc0ea28dd47730ee5d0c8f721e8 Mon Sep 17 00:00:00 2001 From: Jake Fennick Date: Thu, 9 Mar 2023 11:22:10 -0700 Subject: [PATCH] added PermissionError --- cwltool/job.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cwltool/job.py b/cwltool/job.py index 6693c4cfd..607fb782c 100644 --- a/cwltool/job.py +++ b/cwltool/job.py @@ -101,8 +101,11 @@ def relink_initialworkdir( except PermissionError: pass elif os.path.isdir(host_outdir_tgt) and not vol.resolved.startswith("_:"): - ensure_writable(host_outdir_tgt, include_root=True) - shutil.rmtree(host_outdir_tgt) + try: + ensure_writable(host_outdir_tgt, include_root=True) + shutil.rmtree(host_outdir_tgt) + except PermissionError: + pass if not vol.resolved.startswith("_:"): try: os.symlink(vol.resolved, host_outdir_tgt)