Skip to content

Commit

Permalink
ignore self-signed SSL errors and return None
Browse files Browse the repository at this point in the history
  • Loading branch information
daler committed Dec 22, 2024
1 parent fb93ead commit cbded24
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions bioconda_utils/bioconductor_skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,12 @@ def bioarchive_url(self):
package, otherwise returns None.
"""
url = bioarchive_url(self.package, self.version, self.bioc_version)
response = requests.head(url)
if response.status_code == 200:
return url
try:
response = requests.head(url)
if response.status_code == 200:
return url
except requests.exceptions.SSLError:
pass

@property
def cargoport_url(self):
Expand All @@ -479,16 +482,19 @@ def cargoport_url(self):
it exists.
"""
url = cargoport_url(self.package, self.version, self.bioc_version)
response = requests.head(url)
if response.status_code == 404:
# This is expected if this is a new package or an updated version.
# Cargo Port will archive a working URL upon merging
return
elif response.status_code == 200:
return url
else:
raise PageNotFoundError(
"Unexpected error: {0.status_code} ({0.reason})".format(response))
try:
response = requests.head(url)
if response.status_code == 404:
# This is expected if this is a new package or an updated version.
# Cargo Port will archive a working URL upon merging
return
elif response.status_code == 200:
return url
else:
raise PageNotFoundError(
"Unexpected error: {0.status_code} ({0.reason})".format(response))
except requests.exceptions.SSLError:
pass

@property
def bioconductor_tarball_url(self):
Expand Down

0 comments on commit cbded24

Please sign in to comment.