home · contact · privacy
Handle UnicodeDecodeError.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 18 Jan 2016 01:43:46 +0000 (02:43 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 18 Jan 2016 01:43:46 +0000 (02:43 +0100)
plomlombot.py

index 4ec6646..7d0f535 100755 (executable)
@@ -109,7 +109,8 @@ def lineparser_loop(io, nickname):
                 try:
                     webpage = urllib.request.urlopen(request, timeout=15)
                 except (urllib.error.HTTPError, urllib.error.URLError,
-                        UnicodeError, http.client.BadStatusLine) as error:
+                        UnicodeError, http.client.BadStatusLine,
+                        UnicodeDecodeError) as error:
                     print("TROUBLE FOLLOWING URL: " + str(error))
                     continue
                 charset = webpage.info().get_content_charset()