From b705c6ecfbb9ccc11b013eb3b6ad001022015bf4 Mon Sep 17 00:00:00 2001 From: djk Date: Fri, 19 Apr 2024 22:17:57 +0900 Subject: [PATCH 1/2] gh-117941: Fix argparse issue-BooleanOptionalAction #117941 --- Lib/argparse.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/argparse.py b/Lib/argparse.py index 0dbdd67a82f391..1d02021417a6d7 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -932,7 +932,10 @@ def __init__(self, def __call__(self, parser, namespace, values, option_string=None): if option_string in self.option_strings: - setattr(namespace, self.dest, not option_string.startswith('--no-')) + if not self.dest.startswith('no'): + setattr(namespace, self.dest, not option_string.startswith('--no-')) + else: + setattr(namespace, self.dest, option_string.count('no') == self.dest.count('no')) def format_usage(self): return ' | '.join(self.option_strings) From 88b82281ef1ed6a5b7691081a73ab1ab3fb6c8fb Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 13:35:29 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/macOS/2024-04-19-13-35-28.gh-issue-117941.s9-8rd.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/macOS/2024-04-19-13-35-28.gh-issue-117941.s9-8rd.rst diff --git a/Misc/NEWS.d/next/macOS/2024-04-19-13-35-28.gh-issue-117941.s9-8rd.rst b/Misc/NEWS.d/next/macOS/2024-04-19-13-35-28.gh-issue-117941.s9-8rd.rst new file mode 100644 index 00000000000000..ec162532bfdf0f --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2024-04-19-13-35-28.gh-issue-117941.s9-8rd.rst @@ -0,0 +1 @@ +write!