changeset 45079:8628cd1122d2

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).
author Manuel Jacob <me@manueljacob.de>
date Fri, 10 Jul 2020 09:55:38 +0200
parents a59aab6078eb
children 00cdac669614
files mercurial/utils/procutil.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)