catch unicode errors, returning nothing

This commit is contained in:
Thorsten
2016-01-06 16:02:54 +01:00
parent 3480491013
commit eb79b8bf80

View File

@@ -144,6 +144,8 @@ def extract_title(url):
(html_text, headers) = fetch_page(url) (html_text, headers) = fetch_page(url)
except URLError as e: except URLError as e:
return None return None
except UnicodeDecodeError:
return None
except Exception as e: except Exception as e:
return 'failed: %s for %s' % (str(e), url) return 'failed: %s for %s' % (str(e), url)