home · contact · privacy
In URL parser, add http.client.BadStatusLine handler.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 17 Jan 2016 23:00:34 +0000 (00:00 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 17 Jan 2016 23:00:34 +0000 (00:00 +0100)
plomlombot.py

index 5fcd517..c1c2308 100755 (executable)
@@ -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()