Skip to content

--integration-options with an unbalanced quote crashes with a raw ValueError #3457

Description

@Quratulain-bilal

description

_parse_integration_options in src/specify_cli/integrations/_helpers.py calls shlex.split(raw_options) unguarded. an unbalanced quote in the flag value (e.g. --integration-options='--commands-dir "foo') makes shlex raise ValueError: No closing quotation, so a raw traceback escapes instead of the clean typer.Exit(1) error every other bad-input path in this function produces (unknown option, missing value, unexpected value all print a message and exit 1).

reachable from specify init --integration-options=... and every specify integration install/switch/upgrade/migrate --integration-options=....

repro:

specify integration install generic --integration-options='--commands-dir "foo'
# ValueError: No closing quotation  (raw traceback)

expected: a clean one-line error and exit 1, like a mistyped option name already gives.

note: i used an ai assistant to help investigate and write this up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions