home · contact · privacy
Handle UnicodeError in URL parsing.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 17 Jan 2016 22:33:59 +0000 (23:33 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 17 Jan 2016 22:33:59 +0000 (23:33 +0100)
plomlombot.py

index dc6577a..6112dcb 100755 (executable)
@@ -100,8 +100,8 @@ def lineparser_loop(io, nickname):
                 url = matches[i]
                 try:
                     webpage = urllib.request.urlopen(url, timeout=15)
-                except (urllib.error.HTTPError, urllib.error.URLError) \
-                    as error:
+                except (urllib.error.HTTPError, urllib.error.URLError,
+                        UnicodeError) as error:
                     print("TROUBLE FOLLOWING URL: " + str(error))
                     continue
                 charset = webpage.info().get_content_charset()