]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-112527: Fix help text for required options in argparse (GH-112528) (GH...
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 9 Dec 2025 17:36:24 +0000 (19:36 +0200)
committerGitHub <noreply@github.com>
Tue, 9 Dec 2025 17:36:24 +0000 (17:36 +0000)
commit24036f55e4787dae90fd49543fa67eab3ff57669
tree304d14f44e043988bcfa99b3c4badf7953380db4
parent55e16b74fd9f4fbafac43d7b51d5e3c87d2860dd
[3.13] gh-112527: Fix help text for required options in argparse (GH-112528) (GH-142477)

For optional arguments with required=True, the ArgumentDefaultsHelpFormatter
would always add a " (default: None)" to the end of the help text.
Since that's a bit misleading, it is removed with this commit.
(cherry picked from commit 1adb17b1a26e1547d14ca15f915e605cfdda3edd)

Co-authored-by: Fabian Henze <32638720+henzef@users.noreply.github.com>
Lib/argparse.py
Lib/test/test_argparse.py
Misc/NEWS.d/next/Library/2025-12-09-14-40-45.gh-issue-112527.Tvf5Zk.rst [new file with mode: 0644]