From: Christian Heller Date: Sun, 17 Jan 2016 23:00:34 +0000 (+0100) Subject: In URL parser, add http.client.BadStatusLine handler. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/feed.xml?a=commitdiff_plain;h=0358a1448b3b715454461917cb2570f97ff44317;p=plomlombot-irc.git In URL parser, add http.client.BadStatusLine handler. --- diff --git a/plomlombot.py b/plomlombot.py index 5fcd517..c1c2308 100755 --- a/plomlombot.py +++ b/plomlombot.py @@ -7,6 +7,7 @@ import select import time import re import urllib.request +import http.client import html # Defaults, may be overwritten by command line arguments. @@ -105,7 +106,7 @@ def lineparser_loop(io, nickname): try: webpage = urllib.request.urlopen(url, timeout=15) except (urllib.error.HTTPError, urllib.error.URLError, - UnicodeError) as error: + UnicodeError, http.client.BadStatusLine) as error: print("TROUBLE FOLLOWING URL: " + str(error)) continue charset = webpage.info().get_content_charset()