10000 Argparse misparses options in certain situations · Issue #94843 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
Argparse misparses options in certain situations #94843
Closed
@DemiMarie

Description

@DemiMarie

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

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Doc issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0