[PATCH 2 of 4 stable] py3: schedule pycompat.{stdin,stdout,stderr} for removal
Manuel Jacob
me at manueljacob.de
Fri Jun 5 09:44:49 UTC 2020
# HG changeset patch
# User Manuel Jacob <me at manueljacob.de>
# Date 1591334577 -7200
# Fri Jun 05 07:22:57 2020 +0200
# Branch stable
# Node ID 31ab0d15f82bfef3030b653583f89c0d0449fd9c
# Parent ab1bb054809d078f7111c5145c1a4e2c536d37c5
# EXP-Topic streams
py3: schedule pycompat.{stdin,stdout,stderr} for removal
diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -148,6 +148,12 @@ if ispy3:
# 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.
+ # FIXME: Because that makes them only superficially a replacement for
+ # Python 2's standard streams and could mislead people into thinking they
+ # are replacements that behave consistently across Python versions, they
+ # should be removed after Mercurial 5.4. Instead, users should use
+ # procutil.{stdin,stdout,stderr}, which aims to provide a sufficiently
+ # consistent behavior across platforms and Python versions.
# 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
More information about the Mercurial-devel
mailing list