diff msconvert_wrapper.py @ 1:7016f1f10f42 draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msconvert commit d56659dd48f8c554a832787e71aca6ae65c90848
author galaxyp
date Tue, 14 Mar 2017 16:45:30 -0400
parents baa6c072fccc
children
line wrap: on
line diff
--- a/msconvert_wrapper.py	Fri Apr 08 16:08:09 2016 -0400
+++ b/msconvert_wrapper.py	Tue Mar 14 16:45:30 2017 -0400
@@ -7,6 +7,7 @@
 import subprocess
 import re
 import logging
+import shlex
 
 assert sys.version_info[:2] >= (2, 6)
 
@@ -40,7 +41,8 @@
     try:
         with open(tmp_stderr_name, 'wb') as tmp_stderr:
             with open(tmp_stdout_name, 'wb') as tmp_stdout:
-                proc = subprocess.Popen(args=command, shell=True, stderr=tmp_stderr.fileno(), stdout=tmp_stdout.fileno(), stdin=stdin, env=os.environ)
+                args = shlex.split(command) # handle proper splitting of quoted args
+                proc = subprocess.Popen(args=args, shell=False, stderr=tmp_stderr.fileno(), stdout=tmp_stdout.fileno(), stdin=stdin, env=os.environ)
                 returncode = proc.wait()
                 if returncode != 0:
                     raise Exception("Program returned with non-zero exit code %d. stderr: %s" % (returncode, read_stderr()))