From 601e23d816282e125c48b9224d0e47f45d06f9f8 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 31 Jul 2019 17:24:25 -0700 Subject: more check_issn_urls corner-cases --- check_issn_urls.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/check_issn_urls.py b/check_issn_urls.py index 399fd93..ff73353 100755 --- a/check_issn_urls.py +++ b/check_issn_urls.py @@ -94,7 +94,7 @@ def check_gwb(url, match_type='exact'): break time.sleep(5) if not resp.status_code == 200: - sys.stderr.write("CDX ERR {}: {}".format(resp.status_code, url)) + sys.stderr.write("CDX ERR {}: {}\n".format(resp.status_code, url)) return 'error' line = resp.text.strip().split('\n')[0] if line: @@ -134,6 +134,10 @@ def check_url(issnl, url): info['error'] = 'ContentDecodingError' info['terminal_status_code'] = info['status_code'] = -1 return info + except requests.exceptions.InvalidSchema: + info['error'] = 'InvalidSchema' + info['terminal_status_code'] = info['status_code'] = -1 + return info if resp.history: info['status_code'] = resp.history[0].status_code -- cgit v1.2.3