Skip to content

Return the supplied default for missing raw options - #549

Open
rupayon123 wants to merge 2 commits into
python-poetry:mainfrom
rupayon123:fix/raw-option-default
Open

rupayon123 wants to merge 2 commits into
python-poetry:mainfrom
rupayon123:fix/raw-option-default

Conversation

@rupayon123

@rupayon123 rupayon123 commented Oct 27, 2026 •

Copy link
Copy Markdown

ArgvInput.parameter_option("--name", default="fallback") returns False when no token matches. Its existing end-of-options branch already returns the supplied default.

Return that default after an exhausted scan too. Tests cover empty and unrelated tokens, single/list option names, False, 0, None, string and object defaults, plus present values and -- controls. The separate attached-value work in #538 is untouched.

Validation on macOS arm64/CPython 3.13.14 with dependencies from poetry.lock: 274 tests pass, three existing skips; mypy, all-file pre-commit checks, package build and built-wheel API checks pass. The inherited NO_COLOR=1 environment triggers the same existing FORCE_COLOR test failure on the pristine base; the passing full run unsets that inherited variable. Other Python/OS combinations were not run locally.

Includes the required news/549.bugfix.md changelog entry.

@rupayon123
rupayon123 marked this pull request as ready for review October 27, 2026 14:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant