space in path to workflow override causes crash

Issue #674 new
timothy perfitt created an issue

Oh shoot I got this wrong. I did get Imagr to not crash, and it ran a workflow, but it was the wrong workflow. I didn’t notice it hadn’t actually processed the override. :)

I had to put my “.replace(‘ ‘, ‘\\ ‘) into the Popen call. As I had it before, it fails the os.path.exists test.

theURL = Utils.getServerURL()
configFolder=theURL[:theURL.rfind('/')]
script=configFolder+"/workflow_options.sh"
NSLog("override script is at %@", script)
override_values = []
if script.startswith("file://"):
script_path = urlparse.urlparse(urllib2.unquote(script)).path
NSLog("script_path is %@", script_path)
full_output=""
if os.path.exists(script_path):
proc = subprocess.Popen(script_path.replace(' ', '\\ '), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while proc.poll() is None:
output = proc.stdout.readline().strip().decode('UTF-8')
full_output+=output

Comments (0)

  1. Log in to comment