Repository navigation
argparse sometimes tracebacks when all options in a mutually exclusive group are suppressed #96310
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Aug 26, 2022 - added a commit that references this issue
on Aug 26, 2022 - addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Aug 26, 2022 - added a commit that references this issue
on Aug 26, 2022 - added a commit that references this issue
on May 28, 2023 - added a commit that references this issue
on Feb 21, 2024 Traceback (most recent call last):
File "/usr/bin/weevely", line 104, in
arguments = parser.parse_args()
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/argparse.py", line 1886, in parse_args
args, argv = self.parse_known_args(args, namespace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/argparse.py", line 1919, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/argparse.py", line 2143, in _parse_known_args
stop_index = consume_positionals(start_index)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/argparse.py", line 2099, in consume_positionals
take_action(action, args)
File "/usr/lib/python3.11/argparse.py", line 1995, in take_action
action(self, namespace, argument_values, option_string)
File "/usr/lib/python3.11/argparse.py", line 1258, in call
subnamespace, arg_strings = parser.parse_known_args(arg_strings, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/argparse.py", line 1919, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/argparse.py", line 2168, in parse_known_args
self.error(('the following arguments are required: %s') %
File "/usr/share/weevely/core/argparsers.py", line 56, in error
raise ArgparseError(message)
core.weexceptions.ArgparseError: the following arguments are required: url, passwordHow to fix this problem ??
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDoc issues
Bug report
When a subparser contains a mutually exclusive group and the all options in the group are suppressed,
it sometimes errors out with a traceback. The crash depends on other options (their ordering and length) and terminal size.
Reproducer:
Please note that setting
COLUMNSto a high number doesn't trigger the traceback:Your environment
Linked PRs