Skip to content

Commit

Permalink
Fix file:// protocol not working in Ports.fetch_project (#21456)
Browse files Browse the repository at this point in the history
  • Loading branch information
ypujante committed Mar 1, 2024
1 parent 22a1c04 commit 5198d44
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/ports/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ def retrieve():
import requests
response = requests.get(url)
data = response.content
except ImportError:
except (ImportError, requests.exceptions.InvalidSchema):
# requests does not support 'file://' protocol and raises InvalidSchema
from urllib.request import urlopen
f = urlopen(url)
data = f.read()
Expand Down

0 comments on commit 5198d44

Please sign in to comment.