From 4df1f1d2a110128bc9e66f90a235f7060a9e64d3 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Mon, 16 Jul 2018 13:18:42 +0200 Subject: [PATCH] Do not throw on MissingSchema request exception, see #120 --- flatisfy/filters/cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flatisfy/filters/cache.py b/flatisfy/filters/cache.py index a469faa..9f28143 100644 --- a/flatisfy/filters/cache.py +++ b/flatisfy/filters/cache.py @@ -113,14 +113,14 @@ class ImageCache(MemoryCache): if os.path.isfile(filepath): return PIL.Image.open(filepath) # Otherwise, fetch it - req = requests.get(url) try: + req = requests.get(url) req.raise_for_status() image = PIL.Image.open(BytesIO(req.content)) if self.storage_dir: image.save(filepath, format=image.format) return image - except (requests.HTTPError, IOError): + except (requests.HTTPError, requests.exceptions.MissingSchema, IOError): return None def __init__(self, max_items=200, storage_dir=None):