bendudson/py4cl

Question about use of uiop:launch-program

rpgoldman opened this issue · 1 comments

(defun python-start (&optional (command *python-command*))
"Start a new python subprocess
This sets the global variable *python* to the process handle,
in addition to returning it.
COMMAND is a string with the python executable to launch e.g. \"python\"
By default this is is set to *PYTHON-COMMAND*
"
(setf *python*
(uiop:launch-program
(concatenate 'string
"exec "
command ; Run python executable
" "
;; Path *base-pathname* is defined in py4cl.asd
;; Calculate full path to python script
(namestring (merge-pathnames #p"py4cl.py" py4cl/config:*base-directory*)))
:input :stream :output :stream))
(incf *current-python-process-id*))

Is there some reason for using the shell + exec instead of just using the binary directly? This would be something like the following:

(uiop:launch-program
              (list command 
                      ;; Calculate full path to python script
                      (namestring (merge-pathnames #p"py4cl.py" py4cl/config:*base-directory*)) 
              :input :stream :output :stream))

I would guess that using the shell might introduce some oddities depending on the user's configuration.

Thanks!

I ended up removing exec in this context in py4cl2 very early on, so I too am curious about if it was important.