Skip to content

Commit 4d59218

Browse files
committed
fix: Quote pyscript in SGELikeBatchManager
1 parent 72db5fc commit 4d59218

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nipype/pipeline/plugins/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from copy import deepcopy
66
from glob import glob
77
import os
8+
import shlex
89
import shutil
910
from time import sleep, time
1011
from traceback import format_exception
@@ -564,7 +565,7 @@ def _submit_job(self, node, updatehash=False):
564565
batch_dir, name = os.path.split(pyscript)
565566
name = ".".join(name.split(".")[:-1])
566567
batchscript = "\n".join(
567-
(self._template.rstrip("\n"), f"{sys.executable} {pyscript}")
568+
(self._template.rstrip("\n"), shlex.join([sys.executable, pyscript]))
568569
)
569570
batchscriptfile = os.path.join(batch_dir, "batchscript_%s.sh" % name)
570571
with open(batchscriptfile, "w") as fp:

0 commit comments

Comments
 (0)