Skip to content

Pip install should retry for 502 http error code #11843

@kasium

Description

@kasium

What's the problem this feature will solve?

When a HTTP error occurs during install, pip retries when the error is 500, 503, 520, 527 (see

retries = urllib3.Retry(
# Set the total number of retries that a particular request can
# have.
total=retries,
# A 503 error from PyPI typically means that the Fastly -> Origin
# connection got interrupted in some way. A 503 error in general
# is typically considered a transient error so we'll go ahead and
# retry it.
# A 500 may indicate transient error in Amazon S3
# A 520 or 527 - may indicate transient error in CloudFlare
status_forcelist=[500, 503, 520, 527],
). In my case a private pypi answers with 502 from time to time and a try would be great

Describe the solution you'd like

Pip should retry when a 502 error occurs

Alternative Solutions

As an alternative, pip could maintain a opinionated list of retry codes but allow users to overwrite/add new ones so that it fits their needs.

Additional context

n/a

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions