Changeset 3184


Ignore:
Timestamp:
Oct 17, 2012, 11:13:03 AM (12 years ago)
Author:
clarksm
Message:

Do a better job when command is given as string. Eliminating the intermediate shell script allows the kill signal to propagate.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lang/python/Rappture/tools.py

    r3177 r3184  
    1111import re
    1212import subprocess
     13import shlex
    1314import select
    1415import signal
     
    3738                                close_fds=True)
    3839    else:
    39        child = subprocess.Popen(command,shell=True,bufsize=BUFSIZ, \
     40       commandArgs = shlex.split(command)
     41       child = subprocess.Popen(commandArgs,bufsize=BUFSIZ, \
    4042                                stdout=subprocess.PIPE, \
    4143                                stderr=subprocess.PIPE, \
     
    120122    else:
    121123        raise RuntimeError, 'could not open %s for writing' % (fileName)
     124
Note: See TracChangeset for help on using the changeset viewer.