From 6f0c3b799fa665bb45e1b6c902c42e94311ed5f3 Mon Sep 17 00:00:00 2001 From: Ken Odegard Date: Thu, 27 Jul 2023 20:35:35 +0200 Subject: [PATCH 1/2] Do not parse unknowns, reparse entire args (#12936) --- conda/cli/main.py | 4 ++-- ...sing-json-debug-for-executable-subcommands | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 news/12936-fix-parsing-json-debug-for-executable-subcommands diff --git a/conda/cli/main.py b/conda/cli/main.py index 40b04004ebd..ced39b5fe28 100644 --- a/conda/cli/main.py +++ b/conda/cli/main.py @@ -39,7 +39,7 @@ def main_subshell(*args, post_parse_hook=None, **kwargs): args = args or ["--help"] pre_parser = generate_pre_parser(add_help=False) - pre_args, unknown = pre_parser.parse_known_args(args) + pre_args, _ = pre_parser.parse_known_args(args) # the arguments that we want to pass to the main parser later on override_args = {"json": pre_args.json, "debug": pre_args.debug} @@ -52,7 +52,7 @@ def main_subshell(*args, post_parse_hook=None, **kwargs): context.__init__(argparse_args=pre_args) parser = generate_parser(add_help=True) - args = parser.parse_args(unknown, override_args=override_args, namespace=pre_args) + args = parser.parse_args(args, override_args=override_args, namespace=pre_args) context.__init__(argparse_args=args) init_loggers(context) diff --git a/news/12936-fix-parsing-json-debug-for-executable-subcommands b/news/12936-fix-parsing-json-debug-for-executable-subcommands new file mode 100644 index 00000000000..fdc5027894f --- /dev/null +++ b/news/12936-fix-parsing-json-debug-for-executable-subcommands @@ -0,0 +1,19 @@ +### Enhancements + +* + +### Bug fixes + +* Fix regression in parsing `--json` and `--debug` flags for executable plugins. (#12935, #12936) + +### Deprecations + +* + +### Docs + +* + +### Other + +* From b63f152aaf78a014afab66ee48eae663cf563cd6 Mon Sep 17 00:00:00 2001 From: Ken Odegard Date: Thu, 27 Jul 2023 20:56:00 +0200 Subject: [PATCH 2/2] Release 23.7.2 (#12939) --- .authors.yml | 2 +- CHANGELOG.md | 12 ++++++++++++ ...sing-json-debug-for-executable-subcommands | 19 ------------------- 3 files changed, 13 insertions(+), 20 deletions(-) delete mode 100644 news/12936-fix-parsing-json-debug-for-executable-subcommands diff --git a/.authors.yml b/.authors.yml index 756dc2a55b1..b61a182123e 100644 --- a/.authors.yml +++ b/.authors.yml @@ -1957,7 +1957,7 @@ first_commit: 2016-12-11 16:14:03 - name: Ken Odegard email: kodegard@anaconda.com - num_commits: 552 + num_commits: 554 first_commit: 2016-09-27 18:04:21 github: kenodegard aliases: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f9cc11146c..7ad87a4913b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ [//]: # (current developments) +## 23.7.2 (2023-07-27) + +### Bug fixes + +* Fix regression in parsing `--json` and `--debug` flags for executable plugins. (#12935, #12936) + +### Contributors + +* @kenodegard + + + ## 23.7.1 (2023-07-26) ### Bug fixes diff --git a/news/12936-fix-parsing-json-debug-for-executable-subcommands b/news/12936-fix-parsing-json-debug-for-executable-subcommands deleted file mode 100644 index fdc5027894f..00000000000 --- a/news/12936-fix-parsing-json-debug-for-executable-subcommands +++ /dev/null @@ -1,19 +0,0 @@ -### Enhancements - -* - -### Bug fixes - -* Fix regression in parsing `--json` and `--debug` flags for executable plugins. (#12935, #12936) - -### Deprecations - -* - -### Docs - -* - -### Other - -*