Patchwork [7,of,7] procutil: drop unused 'newlines' option from popen*() (API)

login
register
mail settings
Submitter Yuya Nishihara
Date April 7, 2018, 1:39 p.m.
Message ID <bc83d64eb8072ed3e05b.1523108383@mimosa>
Download mbox | patch
Permalink /patch/30548/
State Accepted
Headers show

Comments

Yuya Nishihara - April 7, 2018, 1:39 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1523103997 -32400
#      Sat Apr 07 21:26:37 2018 +0900
# Node ID bc83d64eb8072ed3e05ba6d7580cd36a78fdef83
# Parent  f3b7b60041c2e3663151d5609645dda52d3fad9d
procutil: drop unused 'newlines' option from popen*() (API)

It's unlikely for us to use the universal_newlines option.

Patch

diff --git a/mercurial/utils/procutil.py b/mercurial/utils/procutil.py
--- a/mercurial/utils/procutil.py
+++ b/mercurial/utils/procutil.py
@@ -128,27 +128,25 @@  def _popenwriter(cmd, bufsize):
                          stdin=subprocess.PIPE)
     return _pfile(p, p.stdin)
 
-def popen2(cmd, env=None, newlines=False):
+def popen2(cmd, env=None):
     # Setting bufsize to -1 lets the system decide the buffer size.
     # The default for bufsize is 0, meaning unbuffered. This leads to
     # poor performance on Mac OS X: http://bugs.python.org/issue4194
     p = subprocess.Popen(cmd, shell=True, bufsize=-1,
                          close_fds=closefds,
                          stdin=subprocess.PIPE, stdout=subprocess.PIPE,
-                         universal_newlines=newlines,
                          env=env)
     return p.stdin, p.stdout
 
-def popen3(cmd, env=None, newlines=False):
-    stdin, stdout, stderr, p = popen4(cmd, env, newlines)
+def popen3(cmd, env=None):
+    stdin, stdout, stderr, p = popen4(cmd, env)
     return stdin, stdout, stderr
 
-def popen4(cmd, env=None, newlines=False, bufsize=-1):
+def popen4(cmd, env=None, bufsize=-1):
     p = subprocess.Popen(cmd, shell=True, bufsize=bufsize,
                          close_fds=closefds,
                          stdin=subprocess.PIPE, stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE,
-                         universal_newlines=newlines,
                          env=env)
     return p.stdin, p.stdout, p.stderr, p