From 0358a1448b3b715454461917cb2570f97ff44317 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Mon, 18 Jan 2016 00:00:34 +0100 Subject: [PATCH] In URL parser, add http.client.BadStatusLine handler. --- plomlombot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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() -- 2.30.2