diff -r c32531444cdc -r 227ba1afcb65 mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py Mon Oct 07 21:21:16 2019 -0400 +++ b/mercurial/utils/procutil.py Thu Oct 10 16:00:02 2019 +0200 @@ -53,7 +53,9 @@ if pycompat.iswindows: # Windows doesn't support line buffering stdout = os.fdopen(stdout.fileno(), r'wb', 0) - else: + elif not pycompat.ispy3: + # on Python 3, stdout (sys.stdout.buffer) is already line buffered and + # buffering=1 is not handled in binary mode stdout = os.fdopen(stdout.fileno(), r'wb', 1) if pycompat.iswindows: