Skip to content

A missing option value prints a usage line that lists the deprecated --wheel and leaves out most options #3585

Closed

Description

@Pratik-Kumar-Dhakar

Issue

A missing option value prints a usage line that doesn't describe the command:

$ virtualenv e11 -p
usage: virtualenv [-v] [--app-data APP_DATA] [--discovery DISCOVERY] [-p P]
                  [--python PYTHON] [--try-first-with TRY_FIRST_WITH]
                  [--creator CREATOR] [--seeder SEEDER]
                  [--activators ACTIVATORS]
                  [--extra-search-dir EXTRA_SEARCH_DIR] [--pip PIP]
                  [--setuptools SETUPTOOLS] [--wheel WHEEL] [--prompt PROMPT]
virtualenv: error: argument -p: expected one argument

The usage line comes from the small pre-parser in _validate_option_values (run/__init__.py, added in #3410). It advertises the deprecated, hidden --wheel, and it leaves out dest and most other options. It also splits -p and --python into two separate entries. The real usage (virtualenv --help) looks different.

Passing usage=argparse.SUPPRESS to that parser leaves only the error line.

Environment

  • OS: Zorin OS 17.3 (Ubuntu 22.04 base), Linux 6.8
  • Shell: bash 5.1
  • Python version and path: CPython 3.15.2 (uv-managed)
  • virtualenv: main @ 53748fe (21.15.9)

Activity

  1. added a commit that references this issue on Nov 20, 2026
    1bc073d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions