D1428: logtoprocess: connect all fds to /dev/null to avoid bad interaction with pager

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Thu Nov 16 08:34:21 EST 2017


yuja requested changes to this revision.
yuja added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> logtoprocess.py:89
> +                    stdout=open(os.devnull, 'r'),
> +                    stderr=open(os.devnull, 'r'),
> +                    env=env, close_fds=True, **newsession)

stdout and stderr should be writable. We can simply pass a file
descriptor open with O_RDWR.

  nullfd = os.open(os.devnull, os.O_RDWR)
  Popen(stdin=nullfd, stdout=nullfd, stderr=nullfd)

and `os.close(nullfd)` though it doesn't mater since the process
is terminated with `_exit()`.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1428

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


More information about the Mercurial-devel mailing list