Skip to content

Commit

Permalink
Fix urlgrab to skip mirrors with invalid scheme
Browse files Browse the repository at this point in the history
The package will get downloaded from another mirror
or directly from the API.
  • Loading branch information
dmach committed Apr 28, 2023
1 parent 6d54931 commit ea69d13
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion osc/grabber.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from urllib.parse import unquote
from urllib.error import URLError

import urllib3.exceptions

from .core import streamfile


Expand Down Expand Up @@ -37,7 +39,7 @@ def urlgrab(self, url, filename=None, text=None):
try:
self._grabber.urlgrab(mirror, filename, text)
return True
except (HTTPError, URLError) as e:
except (HTTPError, URLError, urllib3.exceptions.URLSchemeUnknown) as e:

Check warning on line 42 in osc/grabber.py

View check run for this annotation

Codecov / codecov/patch

osc/grabber.py#L42

Added line #L42 was not covered by tests
# try next mirror
pass

Expand Down

0 comments on commit ea69d13

Please sign in to comment.