# HG changeset patch # User Martin Geisler # Date 1247133558 -7200 # Node ID 8ec39725d966a4f2dc0bf308d582c26264d85819 # Parent 9f191931c8592711b02af4ceef9f84e056951843 util: remove unused bufsize argument Removed it correctly this time: the subprocess default is 0, not -1 and so we must pass -1 explicitly. Added a comment to that effect. diff -r 9f191931c859 -r 8ec39725d966 mercurial/util.py --- a/mercurial/util.py Wed Jul 08 17:03:16 2009 -0700 +++ b/mercurial/util.py Thu Jul 09 11:59:18 2009 +0200 @@ -38,13 +38,16 @@ import subprocess closefds = os.name == 'posix' -def popen2(cmd, bufsize=-1): - p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, +def popen2(cmd): + # 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) return p.stdin, p.stdout -def popen3(cmd, bufsize=-1): - p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, +def popen3(cmd): + p = subprocess.Popen(cmd, shell=True, bufsize=-1, close_fds=closefds, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)