From d920ccf041289f6a2bd5e4dc3493a54a6a916c4d Mon Sep 17 00:00:00 2001 From: H-Sorkatti Date: Fri, 31 Jul 2026 18:40:14 +0300 Subject: [PATCH] Changed tempfile.NamedTemporaryFile mode to 'w' to conform with get_pager_file stated return value of typing.TextIO --- src/click/_termui_impl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/click/_termui_impl.py b/src/click/_termui_impl.py index 03961a836..d4912eebc 100644 --- a/src/click/_termui_impl.py +++ b/src/click/_termui_impl.py @@ -623,7 +623,7 @@ def _tempfilepager( # On Windows, NamedTemporaryFile cannot be opened by another process # while Python still has it open, so we use delete=False and clean up manually # rather than using a contextmanager here. - f = tempfile.NamedTemporaryFile(mode="wb", delete=False) + f = tempfile.NamedTemporaryFile(mode="w", delete=False) try: yield t.cast(t.BinaryIO, f), encoding, color f.flush()