# HG changeset patch # User Manuel Jacob <m...@manueljacob.de> # Date 1591334452 -7200 # Fri Jun 05 07:20:52 2020 +0200 # Branch stable # Node ID ab1bb054809d078f7111c5145c1a4e2c536d37c5 # Parent 2dc5ae953c4a8265578acbe7d3e26c93ec8a08fb # EXP-Topic streams py3: add warning about buffering behavior of pycompat.{stdout,stderr}
diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py --- a/mercurial/pycompat.py +++ b/mercurial/pycompat.py @@ -143,6 +143,11 @@ if ispy3: 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 _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel