# HG changeset patch # User Manuel Jacob # Date 2020-07-10 07:55:38 # Node ID 8628cd1122d22567ccaf467bcc2aa5a0e44a4715 # Parent a59aab6078eb78705fca7ff7c9352c144e89eb09 procutil: explain better why line buffering is not possible The sentence “On Python 3, buffered binary streams can't be set line-buffered.” was imprecise, as all streams are just Python classes and we can implement our own (which we did). diff --git a/mercurial/utils/procutil.py b/mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py +++ b/mercurial/utils/procutil.py @@ -99,9 +99,10 @@ if pycompat.iswindows: # buffering. if isatty(stdout): if pycompat.ispy3 or pycompat.iswindows: - # On Python 3, buffered binary streams can't be set line-buffered. - # On Python 2, Windows doesn't support line buffering. - # Therefore we have a wrapper that implements line buffering. + # Python 3 implements its own I/O streams. + # The standard library doesn't offer line-buffered binary streams. + # Python 2 uses the I/O streams provided by the C library. + # The Windows C runtime library doesn't support line buffering. stdout = make_line_buffered(stdout) else: stdout = os.fdopen(stdout.fileno(), 'wb', 1)