From 92788102b525986b266f18fb7d2a356538bc1f9a Mon Sep 17 00:00:00 2001 From: Edward Powell Date: Sun, 15 Feb 2015 10:01:12 -0500 Subject: [PATCH] wikipedia: Fix special characters in urls Thanks to @Tomin1 for the solution. Closes #724 --- wikipedia.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wikipedia.py b/wikipedia.py index d0fa41a931..bc09911b93 100644 --- a/wikipedia.py +++ b/wikipedia.py @@ -12,6 +12,12 @@ import json import re +import sys +if sys.version_info.major < 3: + from urlparse import unquote +else: + from urllib.parse import unquote + REDIRECT = re.compile(r'^REDIRECT (.*)') @@ -90,7 +96,7 @@ def mw_info(bot, trigger, found_match=None): server. """ match = found_match or trigger - say_snippet(bot, match.group(1), match.group(2), show_url=False) + say_snippet(bot, match.group(1), unquote(match.group(2)), show_url=False) @commands('w', 'wiki', 'wik')