Fix links validation (#1421)

This commit is contained in:
Sitram 2020-10-18 11:31:45 +03:00 committed by GitHub
parent a3e9fa01ce
commit e35769370c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -34,7 +34,11 @@ def validate_links(links):
except socket.error as socketerror:
errors.append("SOC: {} : {}".format(socketerror, link))
except Exception as e:
errors.append("ERR: {} : {}".format(e, link))
# Ignore some exceptions which are not actually errors.
# The list below should be extended with other exceptions in the future if needed
if ((-1 != str(e).find("Content purported to be compressed with gzip but failed to decompress.")) and
(-1 != str(e).find("[SSL: CERTIFICATE_VERIFY_FAIL)ED] certificate verify failed (_ssl.c:852)"))) :
errors.append("ERR: {} : {}".format(e, link))
return errors
if __name__ == "__main__":