# HG changeset patch # User Manuel Jacob # Date 1594367738 -7200 # 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 -r a59aab6078eb -r 8628cd1122d2 mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py Tue Jul 07 12:13:40 2020 +0200 +++ b/mercurial/utils/procutil.py Fri Jul 10 09:55:38 2020 +0200 @@ -99,9 +99,10 @@ # 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)