'If redirect_output is True, output from the child is redirected
to a file on disk and this method returns the path to that file.'

def __call__(self, redirect_output=True, cwd=None, priority=None):

    exe = (self.gui_executable if self.gui else self.executable)
    env = self.env
    try:
        env['ORIGWD'] = binascii.hexlify(cPickle.dumps((cwd or os.path.abspath(os.getcwdu()))))
    except EnvironmentError:
        env['ORIGWD'] = binascii.hexlify(cPickle.dumps((cwd or os.path.expanduser(u'~'))))
    _cwd = cwd
    if (priority is None):
        priority = prefs['worker_process_priority']
    cmd = ([exe] if isinstance(exe, basestring) else exe)
    args = {'env': env, 'cwd': _cwd}
    if iswindows:
        priority = {'high': win32process.HIGH_PRIORITY_CLASS, 'normal': win32process.NORMAL_PRIORITY_CLASS, 'low': win32process.IDLE_PRIORITY_CLASS}[priority]
        args['creationflags'] = (win32process.CREATE_NO_WINDOW | priority)
    else:
        niceness = {'normal': 0, 'low': 10, 'high': 20}[priority]
        args['preexec_fn'] = partial(renice, niceness)
    ret = None
    if redirect_output:
        self._file = PersistentTemporaryFile('_worker_redirect.log')
        args['stdout'] = self._file._fd
        args['stderr'] = subprocess.STDOUT
        if iswindows:
            args['stdin'] = subprocess.PIPE
        ret = self._file.name
    if (iswindows and ('stdin' not in args)):
        args['stdin'] = subprocess.PIPE
        args['stdout'] = windows_null_file
        args['stderr'] = subprocess.STDOUT
    if (not iswindows):
        args['close_fds'] = True
    self.child = subprocess.Popen(cmd, **args)
    if ('stdin' in args):
        self.child.stdin.close()
    self.log_path = ret
    return ret
