From: Christian Heller Date: Sun, 17 Jan 2016 22:33:59 +0000 (+0100) Subject: Handle UnicodeError in URL parsing. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/day_todos?a=commitdiff_plain;h=349898d870728880a6fe9461be95ea7f161e7749;p=plomlombot-irc.git Handle UnicodeError in URL parsing. --- diff --git a/plomlombot.py b/plomlombot.py index dc6577a..6112dcb 100755 --- a/plomlombot.py +++ b/plomlombot.py @@ -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()