Skip to content

Invalid use-feature value breaks pip #8671

@akaihola

Description

@akaihola

Environment

  • pip version: 20.2
  • Python version: 3.7.7
  • OS: Fedora 30

Description
I made a bad guess for the syntax of how to enable two pip features permanently, and rendered pip completely broken with a simple pip config set command.

Expected behavior
One or both of the following:

  • a syntax check when doing pip config set would reject an invalid value
  • the invalid configuration value would be a warning and still let pip continue

How to Reproduce

  1. Enable a non-existing feature using pip config set global.use-feature <feature>
  2. Try to use any pip subcommand (or just pip)
  3. Pip crashes with an error message

Output

$ pip config set global.use-feature 2020-resolver,fast-deps
Writing to /home/akaihola/.config/pip/pip.conf
$ pip
An error occurred during configuration: option use-feature: invalid choice: '2020-resolver,fast-deps' (choose from '2020-resolver', 'fast-deps')
$ pip config unset --user global.use-feature
An error occurred during configuration: option use-feature: invalid choice: '2020-resolver,fast-deps' (choose from '2020-resolver', 'fast-deps')

The work-around:

$ rm $HOME/.config/pip/pip.conf

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: configurationConfiguration management and loadingtype: bugA confirmed bug or unintended behaviortype: enhancementImprovements to functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions