From 61efc2559844b3d85e1ee6b02712f3e9f4900764 Mon Sep 17 00:00:00 2001 From: Craig de Stigter Date: Wed, 23 Dec 2020 14:50:24 +1300 Subject: [PATCH] Fix buffering bug --- src/click/_termui_impl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/click/_termui_impl.py b/src/click/_termui_impl.py index bdb3e12e2..0b45704fd 100644 --- a/src/click/_termui_impl.py +++ b/src/click/_termui_impl.py @@ -395,6 +395,7 @@ def get_pager_file(color=None): # wrap in a text stream stream = MaybeStripAnsi(stream, color=color, encoding=encoding) yield stream + stream.flush() @contextlib.contextmanager @@ -458,7 +459,7 @@ def _tempfilepager(cmd, color=None): def _nullpager(stream, color=None): """Simply print unformatted text. This is the ultimate fallback.""" encoding = get_best_encoding(stream) - return stream, encoding, color + yield stream, encoding, color class Editor: