From 61f6e92d14c5c1db6a325a2291484ebd1b136068 Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Wed, 22 Aug 2012 17:09:56 -0500 Subject: [PATCH] BUG: subprocess.Popen requres list of arguments to be strings File "/nfsscratch/PREDICT/johnsonhj/src/BRAINSStandAlone-Linux64-gcc44/NIPYPE/nipype/pipeline/plugins/sge.py", line 42, in _is_pending stderr=subprocess.PIPE) File "/nfsscratch/PREDICT/opt/epd-7.2-1-rh5-x86_64/lib/python2.7/subprocess.py", line 679, in __init__ errread, errwrite) File "/nfsscratch/PREDICT/opt/epd-7.2-1-rh5-x86_64/lib/python2.7/subprocess.py", line 1228, in _execute_child raise child_exception TypeError: execv() arg 2 must contain only strings This was causing nodes to crash when using SGE. Simply typecast the integer to a string and the nodes pass. --- nipype/pipeline/plugins/pbs.py | 3 ++- nipype/pipeline/plugins/sge.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nipype/pipeline/plugins/pbs.py b/nipype/pipeline/plugins/pbs.py index 686f791263..f8a177dc69 100644 --- a/nipype/pipeline/plugins/pbs.py +++ b/nipype/pipeline/plugins/pbs.py @@ -36,7 +36,8 @@ def __init__(self, **kwargs): super(PBSPlugin, self).__init__(template, **kwargs) def _is_pending(self, taskid): - proc = subprocess.Popen(["qstat", taskid], + # subprocess.Popen requires taskid to be a string + proc = subprocess.Popen(["qstat", str(taskid)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) _, e = proc.communicate() diff --git a/nipype/pipeline/plugins/sge.py b/nipype/pipeline/plugins/sge.py index 107151ad8e..af9a78620e 100644 --- a/nipype/pipeline/plugins/sge.py +++ b/nipype/pipeline/plugins/sge.py @@ -37,7 +37,8 @@ def __init__(self, **kwargs): super(SGEPlugin, self).__init__(template, **kwargs) def _is_pending(self, taskid): - proc = subprocess.Popen(["qstat", '-j', taskid], + # subprocess.Popen requires taskid to be a string + proc = subprocess.Popen(["qstat", '-j', str(taskid)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) o, _ = proc.communicate()