From 0dbffb30c7a9165758bdd6753d3506aaea106dea Mon Sep 17 00:00:00 2001 From: David Lord Date: Mon, 9 Mar 2020 11:34:23 -0700 Subject: [PATCH] ClickException goes to stderr --- CHANGES.rst | 9 +++++++++ src/click/exceptions.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 78e429d35..fd0255398 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,5 +1,14 @@ .. currentmodule:: click +Version 7.1.1 +------------- + +Unreleased + +- Fix ``ClickException`` output going to stdout instead of stderr. + :issue:`1495` + + Version 7.1 ----------- diff --git a/src/click/exceptions.py b/src/click/exceptions.py index 9cc2f59d1..592ee38f0 100644 --- a/src/click/exceptions.py +++ b/src/click/exceptions.py @@ -39,7 +39,7 @@ def __str__(self): def show(self, file=None): if file is None: file = get_text_stderr() - echo("Error: {}".format(self.format_message(), file=file)) + echo("Error: {}".format(self.format_message()), file=file) class UsageError(ClickException):