# HG changeset patch # User Manuel Jacob # Date 1591334452 -7200 # Node ID 7be784f301faa3baa96e3a2f0b3c2c42f7e8e44a # Parent bad37041fc1ebf071eb36b9db6698312cdb86488 py3: add warning about buffering behavior of pycompat.{stdout,stderr} diff -r bad37041fc1e -r 7be784f301fa mercurial/pycompat.py --- 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