changeset 44918:7be784f301fa stable

py3: add warning about buffering behavior of pycompat.{stdout,stderr}
author Manuel Jacob <me@manueljacob.de>
date Fri, 05 Jun 2020 07:20:52 +0200
parents bad37041fc1e
children 065704cbdbdb
files mercurial/pycompat.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/pycompat.py	Fri Jun 05 04:10:37 2020 +0200
+++ b/mercurial/pycompat.py	Fri Jun 05 07:20:52 2020 +0200
@@ -143,6 +143,11 @@
 
     long = int
 
+    # Warning: sys.stdout.buffer and sys.stderr.buffer do not necessarily have
+    # the same buffering behavior as sys.stdout and sys.stderr. The interpreter
+    # initializes them with block-buffered streams or unbuffered streams (when
+    # the -u option or the PYTHONUNBUFFERED environment variable is set), never
+    # with a line-buffered stream.
     # TODO: .buffer might not exist if std streams were replaced; we'll need
     # a silly wrapper to make a bytes stream backed by a unicode one.
     stdin = sys.stdin.buffer