Skip to content

gh-134262: Catch both URLError and ConnectionError in retries #135365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

emmatyping
Copy link
Member

@emmatyping emmatyping commented Jun 10, 2025

@StanFromIreland pointed to this failure https://github.com/python/cpython/actions/runs/15565936921/job/43829935370?pr=135355 where we fail downloading without useful debug information because we are only catching URLError. We should probably catch both URLError and ConnectionError for both of these retries so that we retry on all connection failures.

Copy link
Contributor

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +8 to 10
import urllib.error
import zipfile
from urllib.request import urlretrieve
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import urllib.error
import zipfile
from urllib.request import urlretrieve
import zipfile
from urllib.error import URLError
from urllib.request import urlretrieve

Some people may prefer keeping them together?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants