From d08aac7381a392cecfe8931821df5e149b58f32a Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sat, 22 Feb 2020 12:33:37 -0800 Subject: cdx: handle empty/null CDX response Sometimes seem to get empty string instead of empty JSON list --- python/sandcrawler/ia.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'python') diff --git a/python/sandcrawler/ia.py b/python/sandcrawler/ia.py index dbafa01..31f0260 100644 --- a/python/sandcrawler/ia.py +++ b/python/sandcrawler/ia.py @@ -123,6 +123,8 @@ class CdxApiClient: if resp.status_code != 200: raise CdxApiError(resp.text) #print(resp.url, file=sys.stderr) + if not resp.text: + return None rj = resp.json() if len(rj) <= 1: return None -- cgit v1.2.3