Mercurial > public > mercurial-scm > hg-stable
diff mercurial/pycompat.py @ 44796: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 | 00e0c5c06ed5 |
children | afcad425a0b6 |
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