Closed
Description
Bug report
The argparse module misparses options in certain complex situations. I am not sure what the exact prerequisites are, but Qubes OS does manage to trigger the issue. QubesOS/qubes-core-admin-client#214 has the details. Sorry for the lack of a minimal reproducer.
Edit: One case where the bug happens is when an option X (which takes an optional argument) is followed by an optional positional parameter, and the two are mutually exclusive. Argparse thinks that --dispvm A B C
is --dispvm=A -- B C
and considers B
to be the optional positional parameter. Since it is mutually incompatible with --dispvm
, an exception is thrown.
Your environment
- CPython versions tested on: 3.8 through 3.10 inclusive
- Operating system and architecture: Linux x86_64
Metadata
Metadata
Assignees
Projects
Status
Doc issues