D1426: logtoprocess: add the possibility to not start a shell

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Wed Dec 13 09:06:41 EST 2017

yuja added a subscriber: mharbison72.
yuja added a comment.

  In https://phab.mercurial-scm.org/D1426#28695, @lothiraldan wrote:
  > Without `DETACHED_PROCESS`, no console is spawned either with `shell=False` or `shell=True` **but** Mercurial will wait for the log-to-process script to finish before ending.
  No idea why, but a simple python script running `subprocess.Popen()` exits
  immediately on my utterly old Windows XP.
    import subprocess
    import sys
    creationflags = subprocess.CREATE_NEW_PROCESS_GROUP
    subprocess.Popen('%s -c "import time; time.sleep(10)"' % sys.executable,
                     shell=True, creationflags=creationflags)
  > So I would say to keep `DETACHED_PROCESS`.
  > The real question is how to do variables expansion with `shell=False`, I don't think that Python has a stdlib function for doing that.
  Emulating cmd.exe behavior wouldn't be easy. If we had to set `shell=False`,
  we'd probably better to document the Windows-specific issue.
  @mharbison72, do you have any idea?

  rHG Mercurial


To: lothiraldan, #hg-reviewers, mbthomas
Cc: mharbison72, durin42, yuja, mbthomas, mercurial-devel

More information about the Mercurial-devel mailing list