Skip to content

--upgrade-embed-wheels exits 0 when upgrades fail and prints a thread traceback for each #3583

Description

@Pratik-Kumar-Dhakar

Issue

virtualenv --upgrade-embed-wheels exits with status 0 even when every upgrade fails. Each failure prints a raw thread traceback, and pip's own error message isn't shown:

$ PIP_NO_INDEX=1 virtualenv --upgrade-embed-wheels --app-data "$(mktemp -d)" > up.log 2>&1; echo "exit=$?"
exit=0
$ grep -c '^Traceback' up.log
16
$ grep -m1 'Exception in thread' up.log
Exception in thread Thread-8 (_run_manual_upgrade):

Each traceback ends in subprocess.CalledProcessError: ... 'download' ... returned non-zero exit status 1. An unreachable PIP_INDEX_URL behaves the same way.

handle_extra_commands already does raise SystemExit(manual_upgrade(...)), but manual_upgrade always returns None, and an exception in _run_manual_upgrade only ends its thread.

Expected: a non-zero exit and one readable error line per distribution that failed.

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)
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