From 038e4850817a9c82abab42abf50f734c1e8df48b Mon Sep 17 00:00:00 2001 From: Gregory Soutade Date: Sun, 29 Jan 2017 09:12:47 +0100 Subject: [PATCH] Prevent from error when decoding key phrases --- plugins/post_analysis/referers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/post_analysis/referers.py b/plugins/post_analysis/referers.py index aeceb8a..37b470a 100644 --- a/plugins/post_analysis/referers.py +++ b/plugins/post_analysis/referers.py @@ -112,7 +112,11 @@ class IWLAPostAnalysisReferers(IPlugin): groups = key_phrase_re.match(p) if groups: key_phrase = groups.groupdict()['key_phrase'] - key_phrase = urllib.unquote_plus(key_phrase).decode('utf8') + try: + key_phrase = urllib.unquote_plus(key_phrase).decode('utf8') + except Exception, e: + print(e) + continue if not key_phrase in key_phrases.keys(): key_phrases[key_phrase] = 1 else: