From: Savannah Ostrowski Date: Fri, 5 Dec 2025 16:21:31 +0000 (-0800) Subject: GH-139862: Remove `color` from HelpFormatter (#142274) X-Git-Tag: v3.15.0a3~196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b145297301fbcb18461a4e933a4188b2515fad4;p=thirdparty%2FPython%2Fcpython.git GH-139862: Remove `color` from HelpFormatter (#142274) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- diff --git a/Lib/argparse.py b/Lib/argparse.py index 55ecdadd8c93..41467707d393 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -166,7 +166,6 @@ class HelpFormatter(object): indent_increment=2, max_help_position=24, width=None, - color=True, ): # default setting for width if width is None: @@ -174,7 +173,6 @@ class HelpFormatter(object): width = shutil.get_terminal_size().columns width -= 2 - self._set_color(color) self._prog = prog self._indent_increment = indent_increment self._max_help_position = min(max_help_position, diff --git a/Misc/NEWS.d/next/Library/2025-12-04-23-24-24.gh-issue-139862.NBfsD4.rst b/Misc/NEWS.d/next/Library/2025-12-04-23-24-24.gh-issue-139862.NBfsD4.rst new file mode 100644 index 000000000000..2bee8881a757 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-12-04-23-24-24.gh-issue-139862.NBfsD4.rst @@ -0,0 +1 @@ +Remove ``color`` parameter from :class:`!argparse.HelpFormatter` constructor. Color is controlled by :class:`~argparse.ArgumentParser`.