Mercurial > public > mercurial-scm > hg
comparison mercurial/utils/procutil.py @ 40498:8fab95aa5280
procutil: port over windows encoding fixes from logtoprocess
Differential Revision: https://phab.mercurial-scm.org/D5121
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 16 Oct 2018 14:42:57 -0400 |
parents | 3fbfbc8c9f82 |
children | 1d3bed7d2923 |
comparison
equal
deleted
inserted
replaced
40497:3fbfbc8c9f82 | 40498:8fab95aa5280 |
---|---|
479 def runbgcommand(script, env, shell=False, stdout=None, stderr=None): | 479 def runbgcommand(script, env, shell=False, stdout=None, stderr=None): |
480 '''Spawn a command without waiting for it to finish.''' | 480 '''Spawn a command without waiting for it to finish.''' |
481 # we can't use close_fds *and* redirect stdin. I'm not sure that we | 481 # we can't use close_fds *and* redirect stdin. I'm not sure that we |
482 # need to because the detached process has no console connection. | 482 # need to because the detached process has no console connection. |
483 subprocess.Popen( | 483 subprocess.Popen( |
484 script, shell=shell, env=env, close_fds=True, | 484 tonativestr(script), |
485 creationflags=_creationflags, stdout=stdout, stderr=stderr) | 485 shell=shell, env=tonativeenv(env), close_fds=True, |
486 creationflags=_creationflags, stdout=stdout, | |
487 stderr=stderr) | |
486 else: | 488 else: |
487 def runbgcommand(cmd, env, shell=False, stdout=None, stderr=None): | 489 def runbgcommand(cmd, env, shell=False, stdout=None, stderr=None): |
488 '''Spawn a command without waiting for it to finish.''' | 490 '''Spawn a command without waiting for it to finish.''' |
489 # double-fork to completely detach from the parent process | 491 # double-fork to completely detach from the parent process |
490 # based on http://code.activestate.com/recipes/278731 | 492 # based on http://code.activestate.com/recipes/278731 |